From 738f84bf318e2338cf22adbb4286c5541f4ec694 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Tue, 7 May 2024 23:56:27 +0900 Subject: [PATCH] Emoji class Close https://github.com/dahlia/fedify/issues/48 --- CHANGES.md | 2 + codegen/__snapshots__/class.test.ts.snap | 2536 ++++++++++++---------- federation/handler.test.ts | 8 + vocab/__snapshots__/vocab.test.ts.snap | 97 + vocab/announce.yaml | 4 +- vocab/article.yaml | 4 +- vocab/create.yaml | 4 +- vocab/emoji.yaml | 11 + vocab/note.yaml | 4 +- vocab/update.yaml | 4 +- 10 files changed, 1500 insertions(+), 1174 deletions(-) create mode 100644 vocab/emoji.yaml diff --git a/CHANGES.md b/CHANGES.md index acdb058..ba3f8ce 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,6 +10,8 @@ To be released. - Added `Hashtag` class to Activity Vocabulary API. [[#48]] + - Added `Emoji` class to Activity Vocabulary API. [[#48]] + - Added more log messages using the [LogTape] library. Currently the below logger categories are used: diff --git a/codegen/__snapshots__/class.test.ts.snap b/codegen/__snapshots__/class.test.ts.snap index d356afe..171e4a8 100644 --- a/codegen/__snapshots__/class.test.ts.snap +++ b/codegen/__snapshots__/class.test.ts.snap @@ -12,9 +12,14 @@ import { exportSpki, importSpki } from \\"../runtime/key.ts\\"; import { LanguageString } from \\"../runtime/langstr.ts\\"; -/** A pair of property name and value. +/** Describes an object of any kind. The Object type serves as the base type for + * most of the other kinds of objects defined in the Activity Vocabulary, + * including other Core types such as {@link Activity}, + * {@link IntransitiveActivity}, {@link Collection} and + * {@link OrderedCollection}. + * */ -export class PropertyValue { +export class Object { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -29,16 +34,41 @@ export class PropertyValue { } /** - * The type URI of {@link PropertyValue}: \`http://schema.org#PropertyValue\`. + * The type URI of {@link Object}: \`https://www.w3.org/ns/activitystreams#Object\`. */ static get typeId(): URL { - return new URL(\\"http://schema.org#PropertyValue\\"); + return new URL(\\"https://www.w3.org/ns/activitystreams#Object\\"); } - #_4ZHbBuK7PrsvGgrjM8wgc6KMWjav: (string | LanguageString)[] = []; -#_2cSy2magg4iZ7zLaG8U7DiJMoCkx: (string | LanguageString)[] = []; + #_49BipA5dq9eoH8LX8xdsVumveTca: (Object | Link | PropertyValue | URL)[] = []; +#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py: (Application | Group | Organization | Person | Service | URL)[] = []; +#_3ocC3VVi88cEd5sPWL8djkZsvTN6: (Object | URL)[] = []; +#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz: (string | LanguageString)[] = []; +#_3mhZzGXSpQ431mBSz2kvych22v4e: (Object | Link | URL)[] = []; +#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav: (string | LanguageString)[] = []; +#_219RwDanjScTv5tYCjwGZVCM7KZ9: Temporal.Instant[] = []; +#_86xFhmgBapoMvYqjbjRuDPayTrS: (Object | Link | URL)[] = []; +#_33CjRLy5ujtsUrwRSCrsggvGdKuR: (Image | URL)[] = []; +#_3dXrUdkARxwyJLtJcYi1AJ92H41U: (Image | URL)[] = []; +#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s: (Object | Link | URL)[] = []; +#_31k5MUZJsnsPNg8dQQJieWaXTFnR: (Object | Link | URL)[] = []; +#_gCVTegXxWWCw6wWRxa1QF65zusg: (Link | Object | URL)[] = []; +#_5e258TDXtuhaFRPZiGoDfEpjdMr: Temporal.Instant[] = []; +#_7UpwM3JWcXhADcscukEehBorf6k: (Collection | URL)[] = []; +#_2w3Jmue4up8iVDUA51WZqomEF438: Temporal.Instant[] = []; +#_4LqirZspQbFWWQEbFcXAxm7tTDN1: (string | LanguageString)[] = []; +#_5chuqj6s95p5gg2sk1HntGfarRf: (Object | Link | URL)[] = []; +#_385aB7ySixcf5Un6z3VsWmThgCzQ: Temporal.Instant[] = []; +#_2oPEH9MQ3aj8JVwyYuWkqoVwV865: (URL | Link)[] = []; +#_3hFbw7DTpHhq3cvVhkY8njhcsXbd: (Object | URL)[] = []; +#_aLZupjwL8XB7tzdLgCMXdjZ6qej: (Object | URL)[] = []; +#_42a1SvBs24QSLzKcfjCyNTjW5a1g: (Object | URL)[] = []; +#_3qvegKUB8YLgTXRpEf8E6JZSkz2H: (Object | URL)[] = []; +#_3BLrzmscsjHCw8TF5BHRW9WkPnX8: string[] = []; +#_3bNvLMBN1bCJETiTihM3wvi1B2JX: Temporal.Duration[] = []; +#_u8gdcDTtChQ4tbSQMXc4cYWyum7: boolean[] = []; /** - * Constructs a new instance of PropertyValue with the given values. + * Constructs a new instance of Object with the given values. * @param values The values to initialize the instance with. * @param options The options to use for initialization. */ @@ -46,7 +76,22 @@ export class PropertyValue { values: { id?: URL | null; -name?: string | LanguageString | null;value?: string | LanguageString | 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;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;} , { documentLoader, @@ -61,862 +106,98 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} this.#contextLoader = contextLoader; this.id = values.id ?? null; + if (\\"attachments\\" in values && values.attachments != null) { + + this.#_49BipA5dq9eoH8LX8xdsVumveTca = values.attachments; + } + + if (\\"attribution\\" in values && values.attribution != null) { + this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py = [values.attribution]; + } + + if (\\"attributions\\" in values && values.attributions != null) { + + if (\\"attribution\\" in values && + values.attribution != null) { + throw new TypeError( + \\"Cannot initialize both attribution and \\" + + \\"attributions at the same time.\\", + ); + } + + this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py = values.attributions; + } + + if (\\"audience\\" in values && values.audience != null) { + this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6 = [values.audience]; + } + + if (\\"audiences\\" in values && values.audiences != null) { + + if (\\"audience\\" in values && + values.audience != null) { + throw new TypeError( + \\"Cannot initialize both audience and \\" + + \\"audiences at the same time.\\", + ); + } + + this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6 = values.audiences; + } + + if (\\"content\\" in values && values.content != null) { + this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz = [values.content]; + } + + if (\\"contents\\" in values && values.contents != null) { + + if (\\"content\\" in values && + values.content != null) { + throw new TypeError( + \\"Cannot initialize both content and \\" + + \\"contents at the same time.\\", + ); + } + + this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz = values.contents; + } + + if (\\"contexts\\" in values && values.contexts != null) { + + this.#_3mhZzGXSpQ431mBSz2kvych22v4e = values.contexts; + } + if (\\"name\\" in values && values.name != null) { this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav = [values.name]; } - if (\\"value\\" in values && values.value != null) { - this.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx = [values.value]; + if (\\"names\\" in values && values.names != null) { + + if (\\"name\\" in values && + values.name != null) { + throw new TypeError( + \\"Cannot initialize both name and \\" + + \\"names at the same time.\\", + ); + } + + this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav = values.names; } - } - - /** - * Clones this instance, optionally updating it with the given values. - * @param values The values to update the clone with. - * @options The options to use for cloning. - * @returns The cloned instance. - */ - clone( - values: - { -id?: URL | null; -name?: string | LanguageString | null;value?: string | LanguageString | null;} - - = {}, - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - } = {} - ): PropertyValue { - - // @ts-ignore: this.constructor is not recognized as a constructor, but it is. - const clone: PropertyValue = new this.constructor({ id: values.id }, options); - clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav; - if (\\"name\\" in values && values.name != null) { - clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav = [values.name]; + + if (\\"endTime\\" in values && values.endTime != null) { + this.#_219RwDanjScTv5tYCjwGZVCM7KZ9 = [values.endTime]; } - clone.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx = this.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx; - if (\\"value\\" in values && values.value != null) { - clone.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx = [values.value]; + + if (\\"generators\\" in values && values.generators != null) { + + this.#_86xFhmgBapoMvYqjbjRuDPayTrS = values.generators; } - return clone; - } - -/** The name of a property. - */ -get name(): (string | LanguageString | null) { - if (this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav.length < 1) return null; - return this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav[0]; - } + if (\\"icon\\" in values && values.icon != null) { + this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR = [values.icon]; + } -/** The value of a property. - */ -get value(): (string | LanguageString | null) { - if (this.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx.length < 1) return null; - return this.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx[0]; - } - - /** - * Converts this object to a JSON-LD structure. - * @returns The JSON-LD representation of this object. - */ - async toJsonLd(options: { - expand?: boolean, - contextLoader?: DocumentLoader, - } = {}): Promise { - options = { - ...options, - contextLoader: options.contextLoader ?? fetchDocumentLoader, - }; - // deno-lint-ignore no-unused-vars prefer-const - let array: unknown[]; - const values: Record = {}; - array = []; - for (const v of this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav) { - array.push( - typeof v === \\"string\\" ? { \\"@value\\": v } : { - \\"@value\\": v.toString(), - \\"@language\\": v.language.compact(), - } - ); - } - if (array.length > 0) values[\\"https://www.w3.org/ns/activitystreams#name\\"] = array; - - array = []; - for (const v of this.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx) { - array.push( - typeof v === \\"string\\" ? { \\"@value\\": v } : { - \\"@value\\": v.toString(), - \\"@language\\": v.language.compact(), - } - ); - } - if (array.length > 0) values[\\"http://schema.org#value\\"] = array; - - values[\\"@type\\"] = [\\"http://schema.org#PropertyValue\\"]; - if (this.id) values[\\"@id\\"] = this.id.href; - if (options.expand) { - return await jsonld.expand( - values, - { documentLoader: options.contextLoader }, - ); - } - return await jsonld.compact( - values, - [\\"https://www.w3.org/ns/activitystreams\\",{\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\"}], - { documentLoader: options.contextLoader }, - ); - } - - /** - * Converts a JSON-LD structure to an object of this type. - * @param json The JSON-LD structure to convert. - * @returns The object of this type. - * @throws {TypeError} If the given \`json\` is invalid. - */ - static async fromJsonLd( - json: unknown, - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - } = {}, - ): 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 ?? fetchDocumentLoader, - contextLoader: options.contextLoader ?? fetchDocumentLoader, - }; - // deno-lint-ignore no-explicit-any - let values: Record & { \\"@id\\"?: string }; - if (globalThis.Object.keys(json).length == 0) { - values = {}; - } else { - const expanded = await jsonld.expand(json, { - documentLoader: options.contextLoader, - keepFreeFloatingNodes: true, - }); - values = - // deno-lint-ignore no-explicit-any - (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); - } - if (\\"@type\\" in values) { - - if (!values[\\"@type\\"].includes(\\"http://schema.org#PropertyValue\\")) { - throw new TypeError(\\"Invalid type: \\" + values[\\"@type\\"]); - } - } - - const instance = new this( - { id: \\"@id\\" in values ? new URL(values[\\"@id\\"] as string) : undefined }, - options, - ); - const _4ZHbBuK7PrsvGgrjM8wgc6KMWjav: (string | LanguageString)[] = []; - - for (const v of values[\\"https://www.w3.org/ns/activitystreams#name\\"] ?? []) { - if (v == null) continue; - - const decoded = - typeof v === \\"object\\" && \\"@value\\" in v - && typeof v[\\"@value\\"] === \\"string\\" && !(\\"@language\\" in v) ? v[\\"@value\\"] : typeof v === \\"object\\" && \\"@language\\" in v && \\"@value\\" in v - && typeof v[\\"@language\\"] === \\"string\\" - && typeof v[\\"@value\\"] === \\"string\\" ? new LanguageString(v[\\"@value\\"], v[\\"@language\\"]) : undefined - ; - if (typeof decoded === \\"undefined\\") continue; - _4ZHbBuK7PrsvGgrjM8wgc6KMWjav.push(decoded); - - } - instance.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav = _4ZHbBuK7PrsvGgrjM8wgc6KMWjav; - const _2cSy2magg4iZ7zLaG8U7DiJMoCkx: (string | LanguageString)[] = []; - - for (const v of values[\\"http://schema.org#value\\"] ?? []) { - if (v == null) continue; - - const decoded = - typeof v === \\"object\\" && \\"@value\\" in v - && typeof v[\\"@value\\"] === \\"string\\" && !(\\"@language\\" in v) ? v[\\"@value\\"] : typeof v === \\"object\\" && \\"@language\\" in v && \\"@value\\" in v - && typeof v[\\"@language\\"] === \\"string\\" - && typeof v[\\"@value\\"] === \\"string\\" ? new LanguageString(v[\\"@value\\"], v[\\"@language\\"]) : undefined - ; - if (typeof decoded === \\"undefined\\") continue; - _2cSy2magg4iZ7zLaG8U7DiJMoCkx.push(decoded); - - } - instance.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx = _2cSy2magg4iZ7zLaG8U7DiJMoCkx; - - return instance; - } - - protected _getCustomInspectProxy(): Record { - - const proxy: Record = {}; - if (this.id != null) { - proxy.id = { - [Symbol.for(\\"Deno.customInspect\\")]: ( - inspect: typeof Deno.inspect, - options: Deno.InspectOptions, - ): string => \\"URL \\" + inspect(this.id!.href, options), - [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( - _depth: number, - options: unknown, - inspect: (value: unknown, options: unknown) => string, - ): string => \\"URL \\" + inspect(this.id!.href, options), - }; - } - - const _4ZHbBuK7PrsvGgrjM8wgc6KMWjav = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav - // 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(v.href, options), - [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( - _depth: number, - options: unknown, - inspect: (value: unknown, options: unknown) => string, - ): string => \\"URL \\" + inspect(v.href, options), - } - : v); - - if (_4ZHbBuK7PrsvGgrjM8wgc6KMWjav.length == 1) { - proxy.name = _4ZHbBuK7PrsvGgrjM8wgc6KMWjav[0]; - } - - const _2cSy2magg4iZ7zLaG8U7DiJMoCkx = this.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx - // 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(v.href, options), - [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( - _depth: number, - options: unknown, - inspect: (value: unknown, options: unknown) => string, - ): string => \\"URL \\" + inspect(v.href, options), - } - : v); - - if (_2cSy2magg4iZ7zLaG8U7DiJMoCkx.length == 1) { - proxy.value = _2cSy2magg4iZ7zLaG8U7DiJMoCkx[0]; - } - - return proxy; - } - - [Symbol.for(\\"Deno.customInspect\\")]( - inspect: typeof Deno.inspect, - options: Deno.InspectOptions, - ): string { - const proxy = this._getCustomInspectProxy(); - return \\"PropertyValue \\" + inspect(proxy, options); - } - - [Symbol.for(\\"nodejs.util.inspect.custom\\")]( - _depth: number, - options: unknown, - inspect: (value: unknown, options: unknown) => string, - ): string { - const proxy = this._getCustomInspectProxy(); - return \\"PropertyValue \\" + inspect(proxy, options); - } - } - -/** A key owned by an actor. - */ -export class CryptographicKey { - - readonly #documentLoader?: DocumentLoader; - readonly #contextLoader?: DocumentLoader; - readonly id: URL | null; - - protected get _documentLoader(): DocumentLoader | undefined { - return this.#documentLoader; - } - - protected get _contextLoader(): DocumentLoader | undefined { - return this.#contextLoader; - } - - /** - * The type URI of {@link CryptographicKey}: \`https://w3id.org/security#Key\`. - */ - static get typeId(): URL { - return new URL(\\"https://w3id.org/security#Key\\"); - } - #_5UJq9NDh3ZHgswFwwdVxQvJxdx2: (Application | Group | Organization | Person | Service | URL)[] = []; -#_2fE2QMDdg6KFGqa4NEC3TmjApSAD: CryptoKey[] = []; - - /** - * Constructs a new instance of CryptographicKey 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; -owner?: Application | Group | Organization | Person | Service | URL | null;publicKey?: CryptoKey | null;} -, - { - documentLoader, - contextLoader, - }: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - } = {}, - ) { - - this.#documentLoader = documentLoader; - this.#contextLoader = contextLoader; - this.id = values.id ?? null; - - if (\\"owner\\" in values && values.owner != null) { - this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2 = [values.owner]; - } - - if (\\"publicKey\\" in values && values.publicKey != null) { - this.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD = [values.publicKey]; - } - } - - /** - * Clones this instance, optionally updating it with the given values. - * @param values The values to update the clone with. - * @options The options to use for cloning. - * @returns The cloned instance. - */ - clone( - values: - { -id?: URL | null; -owner?: Application | Group | Organization | Person | Service | URL | null;publicKey?: CryptoKey | null;} - - = {}, - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - } = {} - ): CryptographicKey { - - // @ts-ignore: this.constructor is not recognized as a constructor, but it is. - const clone: CryptographicKey = new this.constructor({ id: values.id }, options); - clone.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2 = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2; - if (\\"owner\\" in values && values.owner != null) { - clone.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2 = [values.owner]; - } - clone.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD = this.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD; - if (\\"publicKey\\" in values && values.publicKey != null) { - clone.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD = [values.publicKey]; - } - - return clone; - } - - async #fetchOwner( - url: URL, - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - } = {} - ): Promise { - const documentLoader = - options.documentLoader ?? this._documentLoader ?? fetchDocumentLoader; - const contextLoader = - options.contextLoader ?? this._contextLoader ?? fetchDocumentLoader; - const { document } = await documentLoader(url.href); - - try { - return await Application.fromJsonLd( - document, - { documentLoader, contextLoader }, - ); - } catch (e) { - if (!(e instanceof TypeError)) throw e; - } - - try { - return await Group.fromJsonLd( - document, - { documentLoader, contextLoader }, - ); - } catch (e) { - if (!(e instanceof TypeError)) throw e; - } - - try { - return await Organization.fromJsonLd( - document, - { documentLoader, contextLoader }, - ); - } catch (e) { - if (!(e instanceof TypeError)) throw e; - } - - try { - return await Person.fromJsonLd( - document, - { documentLoader, contextLoader }, - ); - } catch (e) { - if (!(e instanceof TypeError)) throw e; - } - - try { - return await Service.fromJsonLd( - document, - { documentLoader, contextLoader }, - ); - } catch (e) { - if (!(e instanceof TypeError)) throw e; - } - - throw new TypeError(\\"Expected an object of any type of: \\" + - [\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Service\\"].join(\\", \\")); - } - - /** - * Similar to - * {@link CryptographicKey.getOwner}, - * but returns its \`@id\` URL instead of the object itself. - */ - get ownerId(): URL | null { - if (this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2.length < 1) return null; - const v = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2[0]; - if (v instanceof URL) return v; - return v.id; - } - -/** An actor who owns this key. - */ - - async getOwner( - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - } = {} - ): Promise { - if (this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2.length < 1) return null; - const v = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2[0]; - if (v instanceof URL) { - const fetched = - await this.#fetchOwner(v, options); - this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2[0] = fetched; - return fetched; - } - return v; - } - -/** A PEM-encoded public key. - */ -get publicKey(): (CryptoKey | null) { - if (this.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD.length < 1) return null; - return this.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD[0]; - } - - /** - * Converts this object to a JSON-LD structure. - * @returns The JSON-LD representation of this object. - */ - async toJsonLd(options: { - expand?: boolean, - contextLoader?: DocumentLoader, - } = {}): Promise { - options = { - ...options, - contextLoader: options.contextLoader ?? fetchDocumentLoader, - }; - // deno-lint-ignore no-unused-vars prefer-const - let array: unknown[]; - const values: Record = {}; - array = []; - for (const v of this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2) { - array.push( - v instanceof URL ? { \\"@id\\": v.href } : 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) - ); - } - if (array.length > 0) values[\\"https://w3id.org/security#owner\\"] = array; - - array = []; - for (const v of this.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD) { - array.push( - { \\"@value\\": await exportSpki(v) } - ); - } - if (array.length > 0) values[\\"https://w3id.org/security#publicKeyPem\\"] = array; - - values[\\"@type\\"] = [\\"https://w3id.org/security#Key\\"]; - if (this.id) values[\\"@id\\"] = this.id.href; - if (options.expand) { - return await jsonld.expand( - values, - { documentLoader: options.contextLoader }, - ); - } - return await jsonld.compact( - values, - \\"https://w3id.org/security/v1\\", - { documentLoader: options.contextLoader }, - ); - } - - /** - * Converts a JSON-LD structure to an object of this type. - * @param json The JSON-LD structure to convert. - * @returns The object of this type. - * @throws {TypeError} If the given \`json\` is invalid. - */ - static async fromJsonLd( - json: unknown, - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - } = {}, - ): 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 ?? fetchDocumentLoader, - contextLoader: options.contextLoader ?? fetchDocumentLoader, - }; - // deno-lint-ignore no-explicit-any - let values: Record & { \\"@id\\"?: string }; - if (globalThis.Object.keys(json).length == 0) { - values = {}; - } else { - const expanded = await jsonld.expand(json, { - documentLoader: options.contextLoader, - keepFreeFloatingNodes: true, - }); - values = - // deno-lint-ignore no-explicit-any - (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); - } - if (\\"@type\\" in values) { - - if (!values[\\"@type\\"].includes(\\"https://w3id.org/security#Key\\")) { - throw new TypeError(\\"Invalid type: \\" + values[\\"@type\\"]); - } - } - - const instance = new this( - { id: \\"@id\\" in values ? new URL(values[\\"@id\\"] as string) : undefined }, - options, - ); - const _5UJq9NDh3ZHgswFwwdVxQvJxdx2: (Application | Group | Organization | Person | Service | URL)[] = []; - - for (const v of values[\\"https://w3id.org/security#owner\\"] ?? []) { - if (v == null) continue; - - if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) - && globalThis.Object.keys(v).length === 1) { - _5UJq9NDh3ZHgswFwwdVxQvJxdx2.push(new URL(v[\\"@id\\"])); - continue; - } - - const decoded = - 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) : 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) : 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) : 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) : 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) : undefined - ; - if (typeof decoded === \\"undefined\\") continue; - _5UJq9NDh3ZHgswFwwdVxQvJxdx2.push(decoded); - - } - instance.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2 = _5UJq9NDh3ZHgswFwwdVxQvJxdx2; - const _2fE2QMDdg6KFGqa4NEC3TmjApSAD: CryptoKey[] = []; - - for (const v of values[\\"https://w3id.org/security#publicKeyPem\\"] ?? []) { - if (v == null) continue; - _2fE2QMDdg6KFGqa4NEC3TmjApSAD.push(await importSpki(v[\\"@value\\"])) - } - instance.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD = _2fE2QMDdg6KFGqa4NEC3TmjApSAD; - - return instance; - } - - protected _getCustomInspectProxy(): Record { - - const proxy: Record = {}; - if (this.id != null) { - proxy.id = { - [Symbol.for(\\"Deno.customInspect\\")]: ( - inspect: typeof Deno.inspect, - options: Deno.InspectOptions, - ): string => \\"URL \\" + inspect(this.id!.href, options), - [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( - _depth: number, - options: unknown, - inspect: (value: unknown, options: unknown) => string, - ): string => \\"URL \\" + inspect(this.id!.href, options), - }; - } - - const _5UJq9NDh3ZHgswFwwdVxQvJxdx2 = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2 - // 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(v.href, options), - [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( - _depth: number, - options: unknown, - inspect: (value: unknown, options: unknown) => string, - ): string => \\"URL \\" + inspect(v.href, options), - } - : v); - - if (_5UJq9NDh3ZHgswFwwdVxQvJxdx2.length == 1) { - proxy.owner = _5UJq9NDh3ZHgswFwwdVxQvJxdx2[0]; - } - - const _2fE2QMDdg6KFGqa4NEC3TmjApSAD = this.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD - // 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(v.href, options), - [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( - _depth: number, - options: unknown, - inspect: (value: unknown, options: unknown) => string, - ): string => \\"URL \\" + inspect(v.href, options), - } - : v); - - if (_2fE2QMDdg6KFGqa4NEC3TmjApSAD.length == 1) { - proxy.publicKey = _2fE2QMDdg6KFGqa4NEC3TmjApSAD[0]; - } - - return proxy; - } - - [Symbol.for(\\"Deno.customInspect\\")]( - inspect: typeof Deno.inspect, - options: Deno.InspectOptions, - ): string { - const proxy = this._getCustomInspectProxy(); - return \\"CryptographicKey \\" + inspect(proxy, options); - } - - [Symbol.for(\\"nodejs.util.inspect.custom\\")]( - _depth: number, - options: unknown, - inspect: (value: unknown, options: unknown) => string, - ): string { - const proxy = this._getCustomInspectProxy(); - return \\"CryptographicKey \\" + inspect(proxy, options); - } - } - -/** Describes an object of any kind. The Object type serves as the base type for - * most of the other kinds of objects defined in the Activity Vocabulary, - * including other Core types such as {@link Activity}, - * {@link IntransitiveActivity}, {@link Collection} and - * {@link OrderedCollection}. - * - */ -export class Object { - - readonly #documentLoader?: DocumentLoader; - readonly #contextLoader?: DocumentLoader; - readonly id: URL | null; - - protected get _documentLoader(): DocumentLoader | undefined { - return this.#documentLoader; - } - - protected get _contextLoader(): DocumentLoader | undefined { - return this.#contextLoader; - } - - /** - * The type URI of {@link Object}: \`https://www.w3.org/ns/activitystreams#Object\`. - */ - static get typeId(): URL { - return new URL(\\"https://www.w3.org/ns/activitystreams#Object\\"); - } - #_49BipA5dq9eoH8LX8xdsVumveTca: (Object | Link | PropertyValue | URL)[] = []; -#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py: (Application | Group | Organization | Person | Service | URL)[] = []; -#_3ocC3VVi88cEd5sPWL8djkZsvTN6: (Object | URL)[] = []; -#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz: (string | LanguageString)[] = []; -#_3mhZzGXSpQ431mBSz2kvych22v4e: (Object | Link | URL)[] = []; -#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav: (string | LanguageString)[] = []; -#_219RwDanjScTv5tYCjwGZVCM7KZ9: Temporal.Instant[] = []; -#_86xFhmgBapoMvYqjbjRuDPayTrS: (Object | Link | URL)[] = []; -#_33CjRLy5ujtsUrwRSCrsggvGdKuR: (Image | URL)[] = []; -#_3dXrUdkARxwyJLtJcYi1AJ92H41U: (Image | URL)[] = []; -#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s: (Object | Link | URL)[] = []; -#_31k5MUZJsnsPNg8dQQJieWaXTFnR: (Object | Link | URL)[] = []; -#_gCVTegXxWWCw6wWRxa1QF65zusg: (Link | Object | URL)[] = []; -#_5e258TDXtuhaFRPZiGoDfEpjdMr: Temporal.Instant[] = []; -#_7UpwM3JWcXhADcscukEehBorf6k: (Collection | URL)[] = []; -#_2w3Jmue4up8iVDUA51WZqomEF438: Temporal.Instant[] = []; -#_4LqirZspQbFWWQEbFcXAxm7tTDN1: (string | LanguageString)[] = []; -#_5chuqj6s95p5gg2sk1HntGfarRf: (Object | Link | URL)[] = []; -#_385aB7ySixcf5Un6z3VsWmThgCzQ: Temporal.Instant[] = []; -#_2oPEH9MQ3aj8JVwyYuWkqoVwV865: (URL | Link)[] = []; -#_3hFbw7DTpHhq3cvVhkY8njhcsXbd: (Object | URL)[] = []; -#_aLZupjwL8XB7tzdLgCMXdjZ6qej: (Object | URL)[] = []; -#_42a1SvBs24QSLzKcfjCyNTjW5a1g: (Object | URL)[] = []; -#_3qvegKUB8YLgTXRpEf8E6JZSkz2H: (Object | URL)[] = []; -#_3BLrzmscsjHCw8TF5BHRW9WkPnX8: string[] = []; -#_3bNvLMBN1bCJETiTihM3wvi1B2JX: Temporal.Duration[] = []; -#_u8gdcDTtChQ4tbSQMXc4cYWyum7: boolean[] = []; - - /** - * Constructs a new instance of Object 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;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;} -, - { - documentLoader, - contextLoader, - }: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - } = {}, - ) { - - this.#documentLoader = documentLoader; - this.#contextLoader = contextLoader; - this.id = values.id ?? null; - - if (\\"attachments\\" in values && values.attachments != null) { - - this.#_49BipA5dq9eoH8LX8xdsVumveTca = values.attachments; - } - - if (\\"attribution\\" in values && values.attribution != null) { - this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py = [values.attribution]; - } - - if (\\"attributions\\" in values && values.attributions != null) { - - if (\\"attribution\\" in values && - values.attribution != null) { - throw new TypeError( - \\"Cannot initialize both attribution and \\" + - \\"attributions at the same time.\\", - ); - } - - this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py = values.attributions; - } - - if (\\"audience\\" in values && values.audience != null) { - this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6 = [values.audience]; - } - - if (\\"audiences\\" in values && values.audiences != null) { - - if (\\"audience\\" in values && - values.audience != null) { - throw new TypeError( - \\"Cannot initialize both audience and \\" + - \\"audiences at the same time.\\", - ); - } - - this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6 = values.audiences; - } - - if (\\"content\\" in values && values.content != null) { - this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz = [values.content]; - } - - if (\\"contents\\" in values && values.contents != null) { - - if (\\"content\\" in values && - values.content != null) { - throw new TypeError( - \\"Cannot initialize both content and \\" + - \\"contents at the same time.\\", - ); - } - - this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz = values.contents; - } - - if (\\"contexts\\" in values && values.contexts != null) { - - this.#_3mhZzGXSpQ431mBSz2kvych22v4e = values.contexts; - } - - if (\\"name\\" in values && values.name != null) { - this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav = [values.name]; - } - - if (\\"names\\" in values && values.names != null) { - - if (\\"name\\" in values && - values.name != null) { - throw new TypeError( - \\"Cannot initialize both name and \\" + - \\"names at the same time.\\", - ); - } - - this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav = values.names; - } - - if (\\"endTime\\" in values && values.endTime != null) { - this.#_219RwDanjScTv5tYCjwGZVCM7KZ9 = [values.endTime]; - } - - if (\\"generators\\" in values && values.generators != null) { - - this.#_86xFhmgBapoMvYqjbjRuDPayTrS = values.generators; - } - - if (\\"icon\\" in values && values.icon != null) { - this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR = [values.icon]; - } - - if (\\"icons\\" in values && values.icons != null) { + if (\\"icons\\" in values && values.icons != null) { if (\\"icon\\" in values && values.icon != null) { @@ -3424,6 +2705,11 @@ get sensitive(): (boolean | null) { } if (\\"@type\\" in values) { + if (values[\\"@type\\"].includes(\\"http://joinmastodon.org/ns#Emoji\\")) { + delete values[\\"@type\\"]; + return await Emoji.fromJsonLd(values, options); + } + if (values[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Activity\\")) { delete values[\\"@type\\"]; return await Activity.fromJsonLd(values, options); @@ -3631,7 +2917,7 @@ get sensitive(): (boolean | null) { const decoded = typeof v === \\"object\\" && \\"@type\\" in v - && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"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#Like\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"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#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://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\\"].some( + && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"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#Like\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"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#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://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\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, options) : 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( @@ -3717,7 +3003,7 @@ get sensitive(): (boolean | null) { const decoded = typeof v === \\"object\\" && \\"@type\\" in v - && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"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#Like\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"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#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://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\\"].some( + && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"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#Like\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"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#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://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\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, options) : 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( @@ -3765,7 +3051,7 @@ get sensitive(): (boolean | null) { const decoded = typeof v === \\"object\\" && \\"@type\\" in v - && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"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#Like\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"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#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://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\\"].some( + && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"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#Like\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"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#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://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\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, options) : 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( @@ -3818,7 +3104,7 @@ get sensitive(): (boolean | null) { const decoded = typeof v === \\"object\\" && \\"@type\\" in v - && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"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#Like\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"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#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://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\\"].some( + && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"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#Like\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"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#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://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\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, options) : 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( @@ -3843,7 +3129,7 @@ get sensitive(): (boolean | null) { const decoded = typeof v === \\"object\\" && \\"@type\\" in v - && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"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#Like\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"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#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://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\\"].some( + && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"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#Like\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"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#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://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\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, options) : 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( @@ -3871,7 +3157,7 @@ get sensitive(): (boolean | null) { && 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) : typeof v === \\"object\\" && \\"@type\\" in v - && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"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#Like\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"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#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://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\\"].some( + && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"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#Like\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"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#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://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\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, options) : undefined ; @@ -3937,7 +3223,7 @@ get sensitive(): (boolean | null) { const decoded = typeof v === \\"object\\" && \\"@type\\" in v - && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"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#Like\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"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#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://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\\"].some( + && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"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#Like\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"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#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://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\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, options) : 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( @@ -4071,7 +3357,249 @@ get sensitive(): (boolean | null) { }; } - const _49BipA5dq9eoH8LX8xdsVumveTca = this.#_49BipA5dq9eoH8LX8xdsVumveTca + const _49BipA5dq9eoH8LX8xdsVumveTca = this.#_49BipA5dq9eoH8LX8xdsVumveTca + // 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(v.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(v.href, options), + } + : v); + + if (_49BipA5dq9eoH8LX8xdsVumveTca.length > 1 + || !(\\"attachment\\" in proxy) + && _49BipA5dq9eoH8LX8xdsVumveTca.length > 0) { + proxy.attachments = _49BipA5dq9eoH8LX8xdsVumveTca; + } + + const _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py = this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py + // 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(v.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(v.href, options), + } + : v); + + if (_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py.length == 1) { + proxy.attribution = _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py[0]; + } + + if (_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py.length > 1 + || !(\\"attribution\\" in proxy) + && _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py.length > 0) { + proxy.attributions = _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py; + } + + const _3ocC3VVi88cEd5sPWL8djkZsvTN6 = this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6 + // 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(v.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(v.href, options), + } + : v); + + if (_3ocC3VVi88cEd5sPWL8djkZsvTN6.length == 1) { + proxy.audience = _3ocC3VVi88cEd5sPWL8djkZsvTN6[0]; + } + + if (_3ocC3VVi88cEd5sPWL8djkZsvTN6.length > 1 + || !(\\"audience\\" in proxy) + && _3ocC3VVi88cEd5sPWL8djkZsvTN6.length > 0) { + proxy.audiences = _3ocC3VVi88cEd5sPWL8djkZsvTN6; + } + + const _4HuuRSdSrXq8Jj2J9gcdYfoCzeuz = this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz + // 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(v.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(v.href, options), + } + : v); + + if (_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz.length == 1) { + proxy.content = _4HuuRSdSrXq8Jj2J9gcdYfoCzeuz[0]; + } + + if (_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz.length > 1 + || !(\\"content\\" in proxy) + && _4HuuRSdSrXq8Jj2J9gcdYfoCzeuz.length > 0) { + proxy.contents = _4HuuRSdSrXq8Jj2J9gcdYfoCzeuz; + } + + const _3mhZzGXSpQ431mBSz2kvych22v4e = this.#_3mhZzGXSpQ431mBSz2kvych22v4e + // 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(v.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(v.href, options), + } + : v); + + if (_3mhZzGXSpQ431mBSz2kvych22v4e.length > 1 + || !(\\"context\\" in proxy) + && _3mhZzGXSpQ431mBSz2kvych22v4e.length > 0) { + proxy.contexts = _3mhZzGXSpQ431mBSz2kvych22v4e; + } + + const _4ZHbBuK7PrsvGgrjM8wgc6KMWjav = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav + // 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(v.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(v.href, options), + } + : v); + + if (_4ZHbBuK7PrsvGgrjM8wgc6KMWjav.length == 1) { + proxy.name = _4ZHbBuK7PrsvGgrjM8wgc6KMWjav[0]; + } + + if (_4ZHbBuK7PrsvGgrjM8wgc6KMWjav.length > 1 + || !(\\"name\\" in proxy) + && _4ZHbBuK7PrsvGgrjM8wgc6KMWjav.length > 0) { + proxy.names = _4ZHbBuK7PrsvGgrjM8wgc6KMWjav; + } + + const _219RwDanjScTv5tYCjwGZVCM7KZ9 = this.#_219RwDanjScTv5tYCjwGZVCM7KZ9 + // 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(v.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(v.href, options), + } + : v); + + if (_219RwDanjScTv5tYCjwGZVCM7KZ9.length == 1) { + proxy.endTime = _219RwDanjScTv5tYCjwGZVCM7KZ9[0]; + } + + const _86xFhmgBapoMvYqjbjRuDPayTrS = this.#_86xFhmgBapoMvYqjbjRuDPayTrS + // 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(v.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(v.href, options), + } + : v); + + if (_86xFhmgBapoMvYqjbjRuDPayTrS.length > 1 + || !(\\"generator\\" in proxy) + && _86xFhmgBapoMvYqjbjRuDPayTrS.length > 0) { + proxy.generators = _86xFhmgBapoMvYqjbjRuDPayTrS; + } + + const _33CjRLy5ujtsUrwRSCrsggvGdKuR = this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR + // 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(v.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(v.href, options), + } + : v); + + if (_33CjRLy5ujtsUrwRSCrsggvGdKuR.length == 1) { + proxy.icon = _33CjRLy5ujtsUrwRSCrsggvGdKuR[0]; + } + + if (_33CjRLy5ujtsUrwRSCrsggvGdKuR.length > 1 + || !(\\"icon\\" in proxy) + && _33CjRLy5ujtsUrwRSCrsggvGdKuR.length > 0) { + proxy.icons = _33CjRLy5ujtsUrwRSCrsggvGdKuR; + } + + const _3dXrUdkARxwyJLtJcYi1AJ92H41U = this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U + // 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(v.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(v.href, options), + } + : v); + + if (_3dXrUdkARxwyJLtJcYi1AJ92H41U.length == 1) { + proxy.image = _3dXrUdkARxwyJLtJcYi1AJ92H41U[0]; + } + + if (_3dXrUdkARxwyJLtJcYi1AJ92H41U.length > 1 + || !(\\"image\\" in proxy) + && _3dXrUdkARxwyJLtJcYi1AJ92H41U.length > 0) { + proxy.images = _3dXrUdkARxwyJLtJcYi1AJ92H41U; + } + + const _3fpbDrvZgf3Kq1a5V9aByFn8kx3s = this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL ? { @@ -4087,13 +3615,17 @@ get sensitive(): (boolean | null) { } : v); - if (_49BipA5dq9eoH8LX8xdsVumveTca.length > 1 - || !(\\"attachment\\" in proxy) - && _49BipA5dq9eoH8LX8xdsVumveTca.length > 0) { - proxy.attachments = _49BipA5dq9eoH8LX8xdsVumveTca; + if (_3fpbDrvZgf3Kq1a5V9aByFn8kx3s.length == 1) { + proxy.replyTarget = _3fpbDrvZgf3Kq1a5V9aByFn8kx3s[0]; } - const _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py = this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py + if (_3fpbDrvZgf3Kq1a5V9aByFn8kx3s.length > 1 + || !(\\"replyTarget\\" in proxy) + && _3fpbDrvZgf3Kq1a5V9aByFn8kx3s.length > 0) { + proxy.replyTargets = _3fpbDrvZgf3Kq1a5V9aByFn8kx3s; + } + + const _31k5MUZJsnsPNg8dQQJieWaXTFnR = this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL ? { @@ -4109,17 +3641,17 @@ get sensitive(): (boolean | null) { } : v); - if (_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py.length == 1) { - proxy.attribution = _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py[0]; + if (_31k5MUZJsnsPNg8dQQJieWaXTFnR.length == 1) { + proxy.location = _31k5MUZJsnsPNg8dQQJieWaXTFnR[0]; } - if (_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py.length > 1 - || !(\\"attribution\\" in proxy) - && _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py.length > 0) { - proxy.attributions = _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py; + if (_31k5MUZJsnsPNg8dQQJieWaXTFnR.length > 1 + || !(\\"location\\" in proxy) + && _31k5MUZJsnsPNg8dQQJieWaXTFnR.length > 0) { + proxy.locations = _31k5MUZJsnsPNg8dQQJieWaXTFnR; } - const _3ocC3VVi88cEd5sPWL8djkZsvTN6 = this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6 + const _gCVTegXxWWCw6wWRxa1QF65zusg = this.#_gCVTegXxWWCw6wWRxa1QF65zusg // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL ? { @@ -4135,17 +3667,17 @@ get sensitive(): (boolean | null) { } : v); - if (_3ocC3VVi88cEd5sPWL8djkZsvTN6.length == 1) { - proxy.audience = _3ocC3VVi88cEd5sPWL8djkZsvTN6[0]; + if (_gCVTegXxWWCw6wWRxa1QF65zusg.length == 1) { + proxy.preview = _gCVTegXxWWCw6wWRxa1QF65zusg[0]; } - if (_3ocC3VVi88cEd5sPWL8djkZsvTN6.length > 1 - || !(\\"audience\\" in proxy) - && _3ocC3VVi88cEd5sPWL8djkZsvTN6.length > 0) { - proxy.audiences = _3ocC3VVi88cEd5sPWL8djkZsvTN6; + if (_gCVTegXxWWCw6wWRxa1QF65zusg.length > 1 + || !(\\"preview\\" in proxy) + && _gCVTegXxWWCw6wWRxa1QF65zusg.length > 0) { + proxy.previews = _gCVTegXxWWCw6wWRxa1QF65zusg; } - const _4HuuRSdSrXq8Jj2J9gcdYfoCzeuz = this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz + const _5e258TDXtuhaFRPZiGoDfEpjdMr = this.#_5e258TDXtuhaFRPZiGoDfEpjdMr // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL ? { @@ -4161,17 +3693,31 @@ get sensitive(): (boolean | null) { } : v); - if (_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz.length == 1) { - proxy.content = _4HuuRSdSrXq8Jj2J9gcdYfoCzeuz[0]; + if (_5e258TDXtuhaFRPZiGoDfEpjdMr.length == 1) { + proxy.published = _5e258TDXtuhaFRPZiGoDfEpjdMr[0]; } - if (_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz.length > 1 - || !(\\"content\\" in proxy) - && _4HuuRSdSrXq8Jj2J9gcdYfoCzeuz.length > 0) { - proxy.contents = _4HuuRSdSrXq8Jj2J9gcdYfoCzeuz; + const _7UpwM3JWcXhADcscukEehBorf6k = this.#_7UpwM3JWcXhADcscukEehBorf6k + // 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(v.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(v.href, options), + } + : v); + + if (_7UpwM3JWcXhADcscukEehBorf6k.length == 1) { + proxy.replies = _7UpwM3JWcXhADcscukEehBorf6k[0]; } - const _3mhZzGXSpQ431mBSz2kvych22v4e = this.#_3mhZzGXSpQ431mBSz2kvych22v4e + const _2w3Jmue4up8iVDUA51WZqomEF438 = this.#_2w3Jmue4up8iVDUA51WZqomEF438 // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL ? { @@ -4187,13 +3733,11 @@ get sensitive(): (boolean | null) { } : v); - if (_3mhZzGXSpQ431mBSz2kvych22v4e.length > 1 - || !(\\"context\\" in proxy) - && _3mhZzGXSpQ431mBSz2kvych22v4e.length > 0) { - proxy.contexts = _3mhZzGXSpQ431mBSz2kvych22v4e; + if (_2w3Jmue4up8iVDUA51WZqomEF438.length == 1) { + proxy.startTime = _2w3Jmue4up8iVDUA51WZqomEF438[0]; } - const _4ZHbBuK7PrsvGgrjM8wgc6KMWjav = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav + const _4LqirZspQbFWWQEbFcXAxm7tTDN1 = this.#_4LqirZspQbFWWQEbFcXAxm7tTDN1 // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL ? { @@ -4209,17 +3753,17 @@ get sensitive(): (boolean | null) { } : v); - if (_4ZHbBuK7PrsvGgrjM8wgc6KMWjav.length == 1) { - proxy.name = _4ZHbBuK7PrsvGgrjM8wgc6KMWjav[0]; + if (_4LqirZspQbFWWQEbFcXAxm7tTDN1.length == 1) { + proxy.summary = _4LqirZspQbFWWQEbFcXAxm7tTDN1[0]; } - if (_4ZHbBuK7PrsvGgrjM8wgc6KMWjav.length > 1 - || !(\\"name\\" in proxy) - && _4ZHbBuK7PrsvGgrjM8wgc6KMWjav.length > 0) { - proxy.names = _4ZHbBuK7PrsvGgrjM8wgc6KMWjav; + if (_4LqirZspQbFWWQEbFcXAxm7tTDN1.length > 1 + || !(\\"summary\\" in proxy) + && _4LqirZspQbFWWQEbFcXAxm7tTDN1.length > 0) { + proxy.summaries = _4LqirZspQbFWWQEbFcXAxm7tTDN1; } - const _219RwDanjScTv5tYCjwGZVCM7KZ9 = this.#_219RwDanjScTv5tYCjwGZVCM7KZ9 + const _5chuqj6s95p5gg2sk1HntGfarRf = this.#_5chuqj6s95p5gg2sk1HntGfarRf // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL ? { @@ -4235,11 +3779,13 @@ get sensitive(): (boolean | null) { } : v); - if (_219RwDanjScTv5tYCjwGZVCM7KZ9.length == 1) { - proxy.endTime = _219RwDanjScTv5tYCjwGZVCM7KZ9[0]; + if (_5chuqj6s95p5gg2sk1HntGfarRf.length > 1 + || !(\\"tag\\" in proxy) + && _5chuqj6s95p5gg2sk1HntGfarRf.length > 0) { + proxy.tags = _5chuqj6s95p5gg2sk1HntGfarRf; } - const _86xFhmgBapoMvYqjbjRuDPayTrS = this.#_86xFhmgBapoMvYqjbjRuDPayTrS + const _385aB7ySixcf5Un6z3VsWmThgCzQ = this.#_385aB7ySixcf5Un6z3VsWmThgCzQ // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL ? { @@ -4255,13 +3801,11 @@ get sensitive(): (boolean | null) { } : v); - if (_86xFhmgBapoMvYqjbjRuDPayTrS.length > 1 - || !(\\"generator\\" in proxy) - && _86xFhmgBapoMvYqjbjRuDPayTrS.length > 0) { - proxy.generators = _86xFhmgBapoMvYqjbjRuDPayTrS; + if (_385aB7ySixcf5Un6z3VsWmThgCzQ.length == 1) { + proxy.updated = _385aB7ySixcf5Un6z3VsWmThgCzQ[0]; } - const _33CjRLy5ujtsUrwRSCrsggvGdKuR = this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR + const _2oPEH9MQ3aj8JVwyYuWkqoVwV865 = this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865 // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL ? { @@ -4277,17 +3821,17 @@ get sensitive(): (boolean | null) { } : v); - if (_33CjRLy5ujtsUrwRSCrsggvGdKuR.length == 1) { - proxy.icon = _33CjRLy5ujtsUrwRSCrsggvGdKuR[0]; + if (_2oPEH9MQ3aj8JVwyYuWkqoVwV865.length == 1) { + proxy.url = _2oPEH9MQ3aj8JVwyYuWkqoVwV865[0]; } - if (_33CjRLy5ujtsUrwRSCrsggvGdKuR.length > 1 - || !(\\"icon\\" in proxy) - && _33CjRLy5ujtsUrwRSCrsggvGdKuR.length > 0) { - proxy.icons = _33CjRLy5ujtsUrwRSCrsggvGdKuR; + if (_2oPEH9MQ3aj8JVwyYuWkqoVwV865.length > 1 + || !(\\"url\\" in proxy) + && _2oPEH9MQ3aj8JVwyYuWkqoVwV865.length > 0) { + proxy.urls = _2oPEH9MQ3aj8JVwyYuWkqoVwV865; } - const _3dXrUdkARxwyJLtJcYi1AJ92H41U = this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U + const _3hFbw7DTpHhq3cvVhkY8njhcsXbd = this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL ? { @@ -4303,17 +3847,17 @@ get sensitive(): (boolean | null) { } : v); - if (_3dXrUdkARxwyJLtJcYi1AJ92H41U.length == 1) { - proxy.image = _3dXrUdkARxwyJLtJcYi1AJ92H41U[0]; + if (_3hFbw7DTpHhq3cvVhkY8njhcsXbd.length == 1) { + proxy.to = _3hFbw7DTpHhq3cvVhkY8njhcsXbd[0]; } - if (_3dXrUdkARxwyJLtJcYi1AJ92H41U.length > 1 - || !(\\"image\\" in proxy) - && _3dXrUdkARxwyJLtJcYi1AJ92H41U.length > 0) { - proxy.images = _3dXrUdkARxwyJLtJcYi1AJ92H41U; + if (_3hFbw7DTpHhq3cvVhkY8njhcsXbd.length > 1 + || !(\\"to\\" in proxy) + && _3hFbw7DTpHhq3cvVhkY8njhcsXbd.length > 0) { + proxy.tos = _3hFbw7DTpHhq3cvVhkY8njhcsXbd; } - const _3fpbDrvZgf3Kq1a5V9aByFn8kx3s = this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s + const _aLZupjwL8XB7tzdLgCMXdjZ6qej = this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL ? { @@ -4329,17 +3873,17 @@ get sensitive(): (boolean | null) { } : v); - if (_3fpbDrvZgf3Kq1a5V9aByFn8kx3s.length == 1) { - proxy.replyTarget = _3fpbDrvZgf3Kq1a5V9aByFn8kx3s[0]; + if (_aLZupjwL8XB7tzdLgCMXdjZ6qej.length == 1) { + proxy.bto = _aLZupjwL8XB7tzdLgCMXdjZ6qej[0]; } - if (_3fpbDrvZgf3Kq1a5V9aByFn8kx3s.length > 1 - || !(\\"replyTarget\\" in proxy) - && _3fpbDrvZgf3Kq1a5V9aByFn8kx3s.length > 0) { - proxy.replyTargets = _3fpbDrvZgf3Kq1a5V9aByFn8kx3s; + if (_aLZupjwL8XB7tzdLgCMXdjZ6qej.length > 1 + || !(\\"bto\\" in proxy) + && _aLZupjwL8XB7tzdLgCMXdjZ6qej.length > 0) { + proxy.btos = _aLZupjwL8XB7tzdLgCMXdjZ6qej; } - const _31k5MUZJsnsPNg8dQQJieWaXTFnR = this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR + const _42a1SvBs24QSLzKcfjCyNTjW5a1g = this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL ? { @@ -4355,17 +3899,83 @@ get sensitive(): (boolean | null) { } : v); - if (_31k5MUZJsnsPNg8dQQJieWaXTFnR.length == 1) { - proxy.location = _31k5MUZJsnsPNg8dQQJieWaXTFnR[0]; + if (_42a1SvBs24QSLzKcfjCyNTjW5a1g.length == 1) { + proxy.cc = _42a1SvBs24QSLzKcfjCyNTjW5a1g[0]; } - if (_31k5MUZJsnsPNg8dQQJieWaXTFnR.length > 1 - || !(\\"location\\" in proxy) - && _31k5MUZJsnsPNg8dQQJieWaXTFnR.length > 0) { - proxy.locations = _31k5MUZJsnsPNg8dQQJieWaXTFnR; + if (_42a1SvBs24QSLzKcfjCyNTjW5a1g.length > 1 + || !(\\"cc\\" in proxy) + && _42a1SvBs24QSLzKcfjCyNTjW5a1g.length > 0) { + proxy.ccs = _42a1SvBs24QSLzKcfjCyNTjW5a1g; } - const _gCVTegXxWWCw6wWRxa1QF65zusg = this.#_gCVTegXxWWCw6wWRxa1QF65zusg + const _3qvegKUB8YLgTXRpEf8E6JZSkz2H = this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H + // 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(v.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(v.href, options), + } + : v); + + if (_3qvegKUB8YLgTXRpEf8E6JZSkz2H.length == 1) { + proxy.bcc = _3qvegKUB8YLgTXRpEf8E6JZSkz2H[0]; + } + + if (_3qvegKUB8YLgTXRpEf8E6JZSkz2H.length > 1 + || !(\\"bcc\\" in proxy) + && _3qvegKUB8YLgTXRpEf8E6JZSkz2H.length > 0) { + proxy.bccs = _3qvegKUB8YLgTXRpEf8E6JZSkz2H; + } + + const _3BLrzmscsjHCw8TF5BHRW9WkPnX8 = this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8 + // 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(v.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(v.href, options), + } + : v); + + if (_3BLrzmscsjHCw8TF5BHRW9WkPnX8.length == 1) { + proxy.mediaType = _3BLrzmscsjHCw8TF5BHRW9WkPnX8[0]; + } + + const _3bNvLMBN1bCJETiTihM3wvi1B2JX = this.#_3bNvLMBN1bCJETiTihM3wvi1B2JX + // 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(v.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(v.href, options), + } + : v); + + if (_3bNvLMBN1bCJETiTihM3wvi1B2JX.length == 1) { + proxy.duration = _3bNvLMBN1bCJETiTihM3wvi1B2JX[0]; + } + + const _u8gdcDTtChQ4tbSQMXc4cYWyum7 = this.#_u8gdcDTtChQ4tbSQMXc4cYWyum7 // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL ? { @@ -4381,125 +3991,481 @@ get sensitive(): (boolean | null) { } : v); - if (_gCVTegXxWWCw6wWRxa1QF65zusg.length == 1) { - proxy.preview = _gCVTegXxWWCw6wWRxa1QF65zusg[0]; + if (_u8gdcDTtChQ4tbSQMXc4cYWyum7.length == 1) { + proxy.sensitive = _u8gdcDTtChQ4tbSQMXc4cYWyum7[0]; } - if (_gCVTegXxWWCw6wWRxa1QF65zusg.length > 1 - || !(\\"preview\\" in proxy) - && _gCVTegXxWWCw6wWRxa1QF65zusg.length > 0) { - proxy.previews = _gCVTegXxWWCw6wWRxa1QF65zusg; + return proxy; + } + + [Symbol.for(\\"Deno.customInspect\\")]( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string { + const proxy = this._getCustomInspectProxy(); + return \\"Object \\" + inspect(proxy, options); + } + + [Symbol.for(\\"nodejs.util.inspect.custom\\")]( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string { + const proxy = this._getCustomInspectProxy(); + return \\"Object \\" + inspect(proxy, options); + } + } + +/** Represents a custom emoji. + */ +export class Emoji extends Object { + + /** + * The type URI of {@link Emoji}: \`http://joinmastodon.org/ns#Emoji\`. + */ + static get typeId(): URL { + return new URL(\\"http://joinmastodon.org/ns#Emoji\\"); + } + + /** + * Constructs a new instance of Emoji 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;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;} +, + { + documentLoader, + contextLoader, + }: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + } = {}, + ) { + super(values, { documentLoader, contextLoader });} + + /** + * Clones this instance, optionally updating it with the given values. + * @param values The values to update the clone with. + * @options The options to use for cloning. + * @returns The cloned instance. + */ + 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;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;} + + = {}, + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + } = {} + ): Emoji { + const clone = super.clone(values, options) as unknown as Emoji; + return clone; + } + + /** + * Converts this object to a JSON-LD structure. + * @returns The JSON-LD representation of this object. + */ + async toJsonLd(options: { + expand?: boolean, + contextLoader?: DocumentLoader, + } = {}): Promise { + options = { + ...options, + contextLoader: options.contextLoader ?? fetchDocumentLoader, + }; + // deno-lint-ignore no-unused-vars prefer-const + let array: unknown[]; + + const baseValues = await super.toJsonLd({ + ...options, + expand: true, + }) as unknown[]; + const values = baseValues[0] as Record; + + values[\\"@type\\"] = [\\"http://joinmastodon.org/ns#Emoji\\"]; + if (this.id) values[\\"@id\\"] = this.id.href; + if (options.expand) { + return await jsonld.expand( + values, + { documentLoader: options.contextLoader }, + ); + } + return await jsonld.compact( + values, + [\\"https://www.w3.org/ns/activitystreams\\",{\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\"}], + { documentLoader: options.contextLoader }, + ); + } + + /** + * Converts a JSON-LD structure to an object of this type. + * @param json The JSON-LD structure to convert. + * @returns The object of this type. + * @throws {TypeError} If the given \`json\` is invalid. + */ + static async fromJsonLd( + json: unknown, + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + } = {}, + ): 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 ?? fetchDocumentLoader, + contextLoader: options.contextLoader ?? fetchDocumentLoader, + }; + // deno-lint-ignore no-explicit-any + let values: Record & { \\"@id\\"?: string }; + if (globalThis.Object.keys(json).length == 0) { + values = {}; + } else { + const expanded = await jsonld.expand(json, { + documentLoader: options.contextLoader, + keepFreeFloatingNodes: true, + }); + values = + // deno-lint-ignore no-explicit-any + (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); + } + if (\\"@type\\" in values) { + + if (!values[\\"@type\\"].includes(\\"http://joinmastodon.org/ns#Emoji\\")) { + throw new TypeError(\\"Invalid type: \\" + values[\\"@type\\"]); + } + } + + const instance = await super.fromJsonLd(values, options); + if (!(instance instanceof Emoji)) { + throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); + } + + return instance; + } + + protected _getCustomInspectProxy(): Record { + const proxy: Record = super._getCustomInspectProxy(); + return proxy; + } + + [Symbol.for(\\"Deno.customInspect\\")]( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string { + const proxy = this._getCustomInspectProxy(); + return \\"Emoji \\" + inspect(proxy, options); + } + + [Symbol.for(\\"nodejs.util.inspect.custom\\")]( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string { + const proxy = this._getCustomInspectProxy(); + return \\"Emoji \\" + inspect(proxy, options); + } + } + +/** A pair of property name and value. + */ +export class PropertyValue { + + readonly #documentLoader?: DocumentLoader; + readonly #contextLoader?: DocumentLoader; + readonly id: URL | null; + + protected get _documentLoader(): DocumentLoader | undefined { + return this.#documentLoader; + } + + protected get _contextLoader(): DocumentLoader | undefined { + return this.#contextLoader; + } + + /** + * The type URI of {@link PropertyValue}: \`http://schema.org#PropertyValue\`. + */ + static get typeId(): URL { + return new URL(\\"http://schema.org#PropertyValue\\"); + } + #_4ZHbBuK7PrsvGgrjM8wgc6KMWjav: (string | LanguageString)[] = []; +#_2cSy2magg4iZ7zLaG8U7DiJMoCkx: (string | LanguageString)[] = []; + + /** + * Constructs a new instance of PropertyValue 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; +name?: string | LanguageString | null;value?: string | LanguageString | null;} +, + { + documentLoader, + contextLoader, + }: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + } = {}, + ) { + + this.#documentLoader = documentLoader; + this.#contextLoader = contextLoader; + this.id = values.id ?? null; + + if (\\"name\\" in values && values.name != null) { + this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav = [values.name]; + } + + if (\\"value\\" in values && values.value != null) { + this.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx = [values.value]; + } } + + /** + * Clones this instance, optionally updating it with the given values. + * @param values The values to update the clone with. + * @options The options to use for cloning. + * @returns The cloned instance. + */ + clone( + values: + { +id?: URL | null; +name?: string | LanguageString | null;value?: string | LanguageString | null;} + + = {}, + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + } = {} + ): PropertyValue { + + // @ts-ignore: this.constructor is not recognized as a constructor, but it is. + const clone: PropertyValue = new this.constructor({ id: values.id }, options); + clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav; + if (\\"name\\" in values && values.name != null) { + clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav = [values.name]; + } + clone.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx = this.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx; + if (\\"value\\" in values && values.value != null) { + clone.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx = [values.value]; + } - const _5e258TDXtuhaFRPZiGoDfEpjdMr = this.#_5e258TDXtuhaFRPZiGoDfEpjdMr - // 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(v.href, options), - [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( - _depth: number, - options: unknown, - inspect: (value: unknown, options: unknown) => string, - ): string => \\"URL \\" + inspect(v.href, options), - } - : v); - - if (_5e258TDXtuhaFRPZiGoDfEpjdMr.length == 1) { - proxy.published = _5e258TDXtuhaFRPZiGoDfEpjdMr[0]; + return clone; + } + +/** The name of a property. + */ +get name(): (string | LanguageString | null) { + if (this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav.length < 1) return null; + return this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav[0]; } - const _7UpwM3JWcXhADcscukEehBorf6k = this.#_7UpwM3JWcXhADcscukEehBorf6k - // 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(v.href, options), - [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( - _depth: number, - options: unknown, - inspect: (value: unknown, options: unknown) => string, - ): string => \\"URL \\" + inspect(v.href, options), - } - : v); - - if (_7UpwM3JWcXhADcscukEehBorf6k.length == 1) { - proxy.replies = _7UpwM3JWcXhADcscukEehBorf6k[0]; +/** The value of a property. + */ +get value(): (string | LanguageString | null) { + if (this.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx.length < 1) return null; + return this.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx[0]; } - const _2w3Jmue4up8iVDUA51WZqomEF438 = this.#_2w3Jmue4up8iVDUA51WZqomEF438 - // 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(v.href, options), - [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( - _depth: number, - options: unknown, - inspect: (value: unknown, options: unknown) => string, - ): string => \\"URL \\" + inspect(v.href, options), - } - : v); + /** + * Converts this object to a JSON-LD structure. + * @returns The JSON-LD representation of this object. + */ + async toJsonLd(options: { + expand?: boolean, + contextLoader?: DocumentLoader, + } = {}): Promise { + options = { + ...options, + contextLoader: options.contextLoader ?? fetchDocumentLoader, + }; + // deno-lint-ignore no-unused-vars prefer-const + let array: unknown[]; + const values: Record = {}; + array = []; + for (const v of this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav) { + array.push( + typeof v === \\"string\\" ? { \\"@value\\": v } : { + \\"@value\\": v.toString(), + \\"@language\\": v.language.compact(), + } + ); + } + if (array.length > 0) values[\\"https://www.w3.org/ns/activitystreams#name\\"] = array; - if (_2w3Jmue4up8iVDUA51WZqomEF438.length == 1) { - proxy.startTime = _2w3Jmue4up8iVDUA51WZqomEF438[0]; + array = []; + for (const v of this.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx) { + array.push( + typeof v === \\"string\\" ? { \\"@value\\": v } : { + \\"@value\\": v.toString(), + \\"@language\\": v.language.compact(), } - - const _4LqirZspQbFWWQEbFcXAxm7tTDN1 = this.#_4LqirZspQbFWWQEbFcXAxm7tTDN1 + ); + } + if (array.length > 0) values[\\"http://schema.org#value\\"] = array; + + values[\\"@type\\"] = [\\"http://schema.org#PropertyValue\\"]; + if (this.id) values[\\"@id\\"] = this.id.href; + if (options.expand) { + return await jsonld.expand( + values, + { documentLoader: options.contextLoader }, + ); + } + return await jsonld.compact( + values, + [\\"https://www.w3.org/ns/activitystreams\\",{\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\"}], + { documentLoader: options.contextLoader }, + ); + } + + /** + * Converts a JSON-LD structure to an object of this type. + * @param json The JSON-LD structure to convert. + * @returns The object of this type. + * @throws {TypeError} If the given \`json\` is invalid. + */ + static async fromJsonLd( + json: unknown, + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + } = {}, + ): 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 ?? fetchDocumentLoader, + contextLoader: options.contextLoader ?? fetchDocumentLoader, + }; + // deno-lint-ignore no-explicit-any + let values: Record & { \\"@id\\"?: string }; + if (globalThis.Object.keys(json).length == 0) { + values = {}; + } else { + const expanded = await jsonld.expand(json, { + documentLoader: options.contextLoader, + keepFreeFloatingNodes: true, + }); + values = // 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(v.href, options), - [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( - _depth: number, - options: unknown, - inspect: (value: unknown, options: unknown) => string, - ): string => \\"URL \\" + inspect(v.href, options), - } - : v); + (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); + } + if (\\"@type\\" in values) { + + if (!values[\\"@type\\"].includes(\\"http://schema.org#PropertyValue\\")) { + throw new TypeError(\\"Invalid type: \\" + values[\\"@type\\"]); + } + } + + const instance = new this( + { id: \\"@id\\" in values ? new URL(values[\\"@id\\"] as string) : undefined }, + options, + ); + const _4ZHbBuK7PrsvGgrjM8wgc6KMWjav: (string | LanguageString)[] = []; + + for (const v of values[\\"https://www.w3.org/ns/activitystreams#name\\"] ?? []) { + if (v == null) continue; - if (_4LqirZspQbFWWQEbFcXAxm7tTDN1.length == 1) { - proxy.summary = _4LqirZspQbFWWQEbFcXAxm7tTDN1[0]; - } - - if (_4LqirZspQbFWWQEbFcXAxm7tTDN1.length > 1 - || !(\\"summary\\" in proxy) - && _4LqirZspQbFWWQEbFcXAxm7tTDN1.length > 0) { - proxy.summaries = _4LqirZspQbFWWQEbFcXAxm7tTDN1; - } + const decoded = + typeof v === \\"object\\" && \\"@value\\" in v + && typeof v[\\"@value\\"] === \\"string\\" && !(\\"@language\\" in v) ? v[\\"@value\\"] : typeof v === \\"object\\" && \\"@language\\" in v && \\"@value\\" in v + && typeof v[\\"@language\\"] === \\"string\\" + && typeof v[\\"@value\\"] === \\"string\\" ? new LanguageString(v[\\"@value\\"], v[\\"@language\\"]) : undefined + ; + if (typeof decoded === \\"undefined\\") continue; + _4ZHbBuK7PrsvGgrjM8wgc6KMWjav.push(decoded); - const _5chuqj6s95p5gg2sk1HntGfarRf = this.#_5chuqj6s95p5gg2sk1HntGfarRf - // 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(v.href, options), - [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( - _depth: number, - options: unknown, - inspect: (value: unknown, options: unknown) => string, - ): string => \\"URL \\" + inspect(v.href, options), - } - : v); + } + instance.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav = _4ZHbBuK7PrsvGgrjM8wgc6KMWjav; + const _2cSy2magg4iZ7zLaG8U7DiJMoCkx: (string | LanguageString)[] = []; + + for (const v of values[\\"http://schema.org#value\\"] ?? []) { + if (v == null) continue; - if (_5chuqj6s95p5gg2sk1HntGfarRf.length > 1 - || !(\\"tag\\" in proxy) - && _5chuqj6s95p5gg2sk1HntGfarRf.length > 0) { - proxy.tags = _5chuqj6s95p5gg2sk1HntGfarRf; - } + const decoded = + typeof v === \\"object\\" && \\"@value\\" in v + && typeof v[\\"@value\\"] === \\"string\\" && !(\\"@language\\" in v) ? v[\\"@value\\"] : typeof v === \\"object\\" && \\"@language\\" in v && \\"@value\\" in v + && typeof v[\\"@language\\"] === \\"string\\" + && typeof v[\\"@value\\"] === \\"string\\" ? new LanguageString(v[\\"@value\\"], v[\\"@language\\"]) : undefined + ; + if (typeof decoded === \\"undefined\\") continue; + _2cSy2magg4iZ7zLaG8U7DiJMoCkx.push(decoded); - const _385aB7ySixcf5Un6z3VsWmThgCzQ = this.#_385aB7ySixcf5Un6z3VsWmThgCzQ + } + instance.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx = _2cSy2magg4iZ7zLaG8U7DiJMoCkx; + + return instance; + } + + protected _getCustomInspectProxy(): Record { + + const proxy: Record = {}; + if (this.id != null) { + proxy.id = { + [Symbol.for(\\"Deno.customInspect\\")]: ( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string => \\"URL \\" + inspect(this.id!.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(this.id!.href, options), + }; + } + + const _4ZHbBuK7PrsvGgrjM8wgc6KMWjav = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL ? { @@ -4515,11 +4481,11 @@ get sensitive(): (boolean | null) { } : v); - if (_385aB7ySixcf5Un6z3VsWmThgCzQ.length == 1) { - proxy.updated = _385aB7ySixcf5Un6z3VsWmThgCzQ[0]; + if (_4ZHbBuK7PrsvGgrjM8wgc6KMWjav.length == 1) { + proxy.name = _4ZHbBuK7PrsvGgrjM8wgc6KMWjav[0]; } - const _2oPEH9MQ3aj8JVwyYuWkqoVwV865 = this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865 + const _2cSy2magg4iZ7zLaG8U7DiJMoCkx = this.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL ? { @@ -4535,141 +4501,373 @@ get sensitive(): (boolean | null) { } : v); - if (_2oPEH9MQ3aj8JVwyYuWkqoVwV865.length == 1) { - proxy.url = _2oPEH9MQ3aj8JVwyYuWkqoVwV865[0]; - } - - if (_2oPEH9MQ3aj8JVwyYuWkqoVwV865.length > 1 - || !(\\"url\\" in proxy) - && _2oPEH9MQ3aj8JVwyYuWkqoVwV865.length > 0) { - proxy.urls = _2oPEH9MQ3aj8JVwyYuWkqoVwV865; + if (_2cSy2magg4iZ7zLaG8U7DiJMoCkx.length == 1) { + proxy.value = _2cSy2magg4iZ7zLaG8U7DiJMoCkx[0]; } - const _3hFbw7DTpHhq3cvVhkY8njhcsXbd = this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd - // 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(v.href, options), - [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( - _depth: number, - options: unknown, - inspect: (value: unknown, options: unknown) => string, - ): string => \\"URL \\" + inspect(v.href, options), - } - : v); + return proxy; + } + + [Symbol.for(\\"Deno.customInspect\\")]( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string { + const proxy = this._getCustomInspectProxy(); + return \\"PropertyValue \\" + inspect(proxy, options); + } + + [Symbol.for(\\"nodejs.util.inspect.custom\\")]( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string { + const proxy = this._getCustomInspectProxy(); + return \\"PropertyValue \\" + inspect(proxy, options); + } + } + +/** A key owned by an actor. + */ +export class CryptographicKey { + + readonly #documentLoader?: DocumentLoader; + readonly #contextLoader?: DocumentLoader; + readonly id: URL | null; + + protected get _documentLoader(): DocumentLoader | undefined { + return this.#documentLoader; + } + + protected get _contextLoader(): DocumentLoader | undefined { + return this.#contextLoader; + } - if (_3hFbw7DTpHhq3cvVhkY8njhcsXbd.length == 1) { - proxy.to = _3hFbw7DTpHhq3cvVhkY8njhcsXbd[0]; - } + /** + * The type URI of {@link CryptographicKey}: \`https://w3id.org/security#Key\`. + */ + static get typeId(): URL { + return new URL(\\"https://w3id.org/security#Key\\"); + } + #_5UJq9NDh3ZHgswFwwdVxQvJxdx2: (Application | Group | Organization | Person | Service | URL)[] = []; +#_2fE2QMDdg6KFGqa4NEC3TmjApSAD: CryptoKey[] = []; + + /** + * Constructs a new instance of CryptographicKey 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; +owner?: Application | Group | Organization | Person | Service | URL | null;publicKey?: CryptoKey | null;} +, + { + documentLoader, + contextLoader, + }: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + } = {}, + ) { + + this.#documentLoader = documentLoader; + this.#contextLoader = contextLoader; + this.id = values.id ?? null; + + if (\\"owner\\" in values && values.owner != null) { + this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2 = [values.owner]; + } - if (_3hFbw7DTpHhq3cvVhkY8njhcsXbd.length > 1 - || !(\\"to\\" in proxy) - && _3hFbw7DTpHhq3cvVhkY8njhcsXbd.length > 0) { - proxy.tos = _3hFbw7DTpHhq3cvVhkY8njhcsXbd; + if (\\"publicKey\\" in values && values.publicKey != null) { + this.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD = [values.publicKey]; + } } + + /** + * Clones this instance, optionally updating it with the given values. + * @param values The values to update the clone with. + * @options The options to use for cloning. + * @returns The cloned instance. + */ + clone( + values: + { +id?: URL | null; +owner?: Application | Group | Organization | Person | Service | URL | null;publicKey?: CryptoKey | null;} + + = {}, + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + } = {} + ): CryptographicKey { + + // @ts-ignore: this.constructor is not recognized as a constructor, but it is. + const clone: CryptographicKey = new this.constructor({ id: values.id }, options); + clone.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2 = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2; + if (\\"owner\\" in values && values.owner != null) { + clone.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2 = [values.owner]; + } + clone.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD = this.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD; + if (\\"publicKey\\" in values && values.publicKey != null) { + clone.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD = [values.publicKey]; + } - const _aLZupjwL8XB7tzdLgCMXdjZ6qej = this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej - // 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(v.href, options), - [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( - _depth: number, - options: unknown, - inspect: (value: unknown, options: unknown) => string, - ): string => \\"URL \\" + inspect(v.href, options), - } - : v); + return clone; + } + + async #fetchOwner( + url: URL, + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + } = {} + ): Promise { + const documentLoader = + options.documentLoader ?? this._documentLoader ?? fetchDocumentLoader; + const contextLoader = + options.contextLoader ?? this._contextLoader ?? fetchDocumentLoader; + const { document } = await documentLoader(url.href); - if (_aLZupjwL8XB7tzdLgCMXdjZ6qej.length == 1) { - proxy.bto = _aLZupjwL8XB7tzdLgCMXdjZ6qej[0]; + try { + return await Application.fromJsonLd( + document, + { documentLoader, contextLoader }, + ); + } catch (e) { + if (!(e instanceof TypeError)) throw e; } - if (_aLZupjwL8XB7tzdLgCMXdjZ6qej.length > 1 - || !(\\"bto\\" in proxy) - && _aLZupjwL8XB7tzdLgCMXdjZ6qej.length > 0) { - proxy.btos = _aLZupjwL8XB7tzdLgCMXdjZ6qej; + try { + return await Group.fromJsonLd( + document, + { documentLoader, contextLoader }, + ); + } catch (e) { + if (!(e instanceof TypeError)) throw e; } - const _42a1SvBs24QSLzKcfjCyNTjW5a1g = this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g - // 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(v.href, options), - [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( - _depth: number, - options: unknown, - inspect: (value: unknown, options: unknown) => string, - ): string => \\"URL \\" + inspect(v.href, options), - } - : v); - - if (_42a1SvBs24QSLzKcfjCyNTjW5a1g.length == 1) { - proxy.cc = _42a1SvBs24QSLzKcfjCyNTjW5a1g[0]; + try { + return await Organization.fromJsonLd( + document, + { documentLoader, contextLoader }, + ); + } catch (e) { + if (!(e instanceof TypeError)) throw e; } - if (_42a1SvBs24QSLzKcfjCyNTjW5a1g.length > 1 - || !(\\"cc\\" in proxy) - && _42a1SvBs24QSLzKcfjCyNTjW5a1g.length > 0) { - proxy.ccs = _42a1SvBs24QSLzKcfjCyNTjW5a1g; + try { + return await Person.fromJsonLd( + document, + { documentLoader, contextLoader }, + ); + } catch (e) { + if (!(e instanceof TypeError)) throw e; } - const _3qvegKUB8YLgTXRpEf8E6JZSkz2H = this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H - // 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(v.href, options), - [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( - _depth: number, - options: unknown, - inspect: (value: unknown, options: unknown) => string, - ): string => \\"URL \\" + inspect(v.href, options), - } - : v); + try { + return await Service.fromJsonLd( + document, + { documentLoader, contextLoader }, + ); + } catch (e) { + if (!(e instanceof TypeError)) throw e; + } + + throw new TypeError(\\"Expected an object of any type of: \\" + + [\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Service\\"].join(\\", \\")); + } - if (_3qvegKUB8YLgTXRpEf8E6JZSkz2H.length == 1) { - proxy.bcc = _3qvegKUB8YLgTXRpEf8E6JZSkz2H[0]; + /** + * Similar to + * {@link CryptographicKey.getOwner}, + * but returns its \`@id\` URL instead of the object itself. + */ + get ownerId(): URL | null { + if (this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2.length < 1) return null; + const v = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2[0]; + if (v instanceof URL) return v; + return v.id; } - if (_3qvegKUB8YLgTXRpEf8E6JZSkz2H.length > 1 - || !(\\"bcc\\" in proxy) - && _3qvegKUB8YLgTXRpEf8E6JZSkz2H.length > 0) { - proxy.bccs = _3qvegKUB8YLgTXRpEf8E6JZSkz2H; +/** An actor who owns this key. + */ + + async getOwner( + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + } = {} + ): Promise { + if (this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2.length < 1) return null; + const v = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2[0]; + if (v instanceof URL) { + const fetched = + await this.#fetchOwner(v, options); + this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2[0] = fetched; + return fetched; + } + return v; } - const _3BLrzmscsjHCw8TF5BHRW9WkPnX8 = this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8 +/** A PEM-encoded public key. + */ +get publicKey(): (CryptoKey | null) { + if (this.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD.length < 1) return null; + return this.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD[0]; + } + + /** + * Converts this object to a JSON-LD structure. + * @returns The JSON-LD representation of this object. + */ + async toJsonLd(options: { + expand?: boolean, + contextLoader?: DocumentLoader, + } = {}): Promise { + options = { + ...options, + contextLoader: options.contextLoader ?? fetchDocumentLoader, + }; + // deno-lint-ignore no-unused-vars prefer-const + let array: unknown[]; + const values: Record = {}; + array = []; + for (const v of this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2) { + array.push( + v instanceof URL ? { \\"@id\\": v.href } : 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) + ); + } + if (array.length > 0) values[\\"https://w3id.org/security#owner\\"] = array; + + array = []; + for (const v of this.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD) { + array.push( + { \\"@value\\": await exportSpki(v) } + ); + } + if (array.length > 0) values[\\"https://w3id.org/security#publicKeyPem\\"] = array; + + values[\\"@type\\"] = [\\"https://w3id.org/security#Key\\"]; + if (this.id) values[\\"@id\\"] = this.id.href; + if (options.expand) { + return await jsonld.expand( + values, + { documentLoader: options.contextLoader }, + ); + } + return await jsonld.compact( + values, + \\"https://w3id.org/security/v1\\", + { documentLoader: options.contextLoader }, + ); + } + + /** + * Converts a JSON-LD structure to an object of this type. + * @param json The JSON-LD structure to convert. + * @returns The object of this type. + * @throws {TypeError} If the given \`json\` is invalid. + */ + static async fromJsonLd( + json: unknown, + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + } = {}, + ): 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 ?? fetchDocumentLoader, + contextLoader: options.contextLoader ?? fetchDocumentLoader, + }; + // deno-lint-ignore no-explicit-any + let values: Record & { \\"@id\\"?: string }; + if (globalThis.Object.keys(json).length == 0) { + values = {}; + } else { + const expanded = await jsonld.expand(json, { + documentLoader: options.contextLoader, + keepFreeFloatingNodes: true, + }); + values = // 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(v.href, options), - [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( - _depth: number, - options: unknown, - inspect: (value: unknown, options: unknown) => string, - ): string => \\"URL \\" + inspect(v.href, options), - } - : v); + (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); + } + if (\\"@type\\" in values) { + + if (!values[\\"@type\\"].includes(\\"https://w3id.org/security#Key\\")) { + throw new TypeError(\\"Invalid type: \\" + values[\\"@type\\"]); + } + } + + const instance = new this( + { id: \\"@id\\" in values ? new URL(values[\\"@id\\"] as string) : undefined }, + options, + ); + const _5UJq9NDh3ZHgswFwwdVxQvJxdx2: (Application | Group | Organization | Person | Service | URL)[] = []; + + for (const v of values[\\"https://w3id.org/security#owner\\"] ?? []) { + if (v == null) continue; - if (_3BLrzmscsjHCw8TF5BHRW9WkPnX8.length == 1) { - proxy.mediaType = _3BLrzmscsjHCw8TF5BHRW9WkPnX8[0]; + if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) + && globalThis.Object.keys(v).length === 1) { + _5UJq9NDh3ZHgswFwwdVxQvJxdx2.push(new URL(v[\\"@id\\"])); + continue; } - const _3bNvLMBN1bCJETiTihM3wvi1B2JX = this.#_3bNvLMBN1bCJETiTihM3wvi1B2JX + const decoded = + 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) : 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) : 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) : 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) : 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) : undefined + ; + if (typeof decoded === \\"undefined\\") continue; + _5UJq9NDh3ZHgswFwwdVxQvJxdx2.push(decoded); + + } + instance.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2 = _5UJq9NDh3ZHgswFwwdVxQvJxdx2; + const _2fE2QMDdg6KFGqa4NEC3TmjApSAD: CryptoKey[] = []; + + for (const v of values[\\"https://w3id.org/security#publicKeyPem\\"] ?? []) { + if (v == null) continue; + _2fE2QMDdg6KFGqa4NEC3TmjApSAD.push(await importSpki(v[\\"@value\\"])) + } + instance.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD = _2fE2QMDdg6KFGqa4NEC3TmjApSAD; + + return instance; + } + + protected _getCustomInspectProxy(): Record { + + const proxy: Record = {}; + if (this.id != null) { + proxy.id = { + [Symbol.for(\\"Deno.customInspect\\")]: ( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string => \\"URL \\" + inspect(this.id!.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(this.id!.href, options), + }; + } + + const _5UJq9NDh3ZHgswFwwdVxQvJxdx2 = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2 // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL ? { @@ -4685,11 +4883,11 @@ get sensitive(): (boolean | null) { } : v); - if (_3bNvLMBN1bCJETiTihM3wvi1B2JX.length == 1) { - proxy.duration = _3bNvLMBN1bCJETiTihM3wvi1B2JX[0]; + if (_5UJq9NDh3ZHgswFwwdVxQvJxdx2.length == 1) { + proxy.owner = _5UJq9NDh3ZHgswFwwdVxQvJxdx2[0]; } - const _u8gdcDTtChQ4tbSQMXc4cYWyum7 = this.#_u8gdcDTtChQ4tbSQMXc4cYWyum7 + const _2fE2QMDdg6KFGqa4NEC3TmjApSAD = this.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL ? { @@ -4705,8 +4903,8 @@ get sensitive(): (boolean | null) { } : v); - if (_u8gdcDTtChQ4tbSQMXc4cYWyum7.length == 1) { - proxy.sensitive = _u8gdcDTtChQ4tbSQMXc4cYWyum7[0]; + if (_2fE2QMDdg6KFGqa4NEC3TmjApSAD.length == 1) { + proxy.publicKey = _2fE2QMDdg6KFGqa4NEC3TmjApSAD[0]; } return proxy; @@ -4717,7 +4915,7 @@ get sensitive(): (boolean | null) { options: Deno.InspectOptions, ): string { const proxy = this._getCustomInspectProxy(); - return \\"Object \\" + inspect(proxy, options); + return \\"CryptographicKey \\" + inspect(proxy, options); } [Symbol.for(\\"nodejs.util.inspect.custom\\")]( @@ -4726,7 +4924,7 @@ get sensitive(): (boolean | null) { inspect: (value: unknown, options: unknown) => string, ): string { const proxy = this._getCustomInspectProxy(); - return \\"Object \\" + inspect(proxy, options); + return \\"CryptographicKey \\" + inspect(proxy, options); } } @@ -5950,7 +6148,7 @@ objects?: (Object | URL)[];} } return await jsonld.compact( values, - [\\"https://www.w3.org/ns/activitystreams\\",{\\"sensitive\\":\\"as:sensitive\\",\\"Hashtag\\":\\"as:Hashtag\\"}], + [\\"https://www.w3.org/ns/activitystreams\\",{\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"sensitive\\":\\"as:sensitive\\",\\"Emoji\\":\\"toot:Emoji\\",\\"Hashtag\\":\\"as:Hashtag\\"}], { documentLoader: options.contextLoader }, ); } @@ -7648,7 +7846,7 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | } return await jsonld.compact( values, - [\\"https://www.w3.org/ns/activitystreams\\",{\\"sensitive\\":\\"as:sensitive\\",\\"Hashtag\\":\\"as:Hashtag\\"}], + [\\"https://www.w3.org/ns/activitystreams\\",{\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"sensitive\\":\\"as:sensitive\\",\\"Emoji\\":\\"toot:Emoji\\",\\"Hashtag\\":\\"as:Hashtag\\"}], { documentLoader: options.contextLoader }, ); } @@ -9309,7 +9507,7 @@ get totalItems(): (number | null) { const decoded = typeof v === \\"object\\" && \\"@type\\" in v - && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"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#Like\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"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#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://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\\"].some( + && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"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#Like\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"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#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://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\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, options) : 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( @@ -10160,7 +10358,7 @@ objects?: (Object | URL)[];} } return await jsonld.compact( values, - [\\"https://www.w3.org/ns/activitystreams\\",{\\"sensitive\\":\\"as:sensitive\\",\\"Hashtag\\":\\"as:Hashtag\\"}], + [\\"https://www.w3.org/ns/activitystreams\\",{\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"sensitive\\":\\"as:sensitive\\",\\"Emoji\\":\\"toot:Emoji\\",\\"Hashtag\\":\\"as:Hashtag\\"}], { documentLoader: options.contextLoader }, ); } @@ -13860,7 +14058,7 @@ get width(): (number | null) { && 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) : typeof v === \\"object\\" && \\"@type\\" in v - && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"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#Like\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"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#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://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\\"].some( + && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"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#Like\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"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#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://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\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, options) : undefined ; @@ -15131,7 +15329,7 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | } return await jsonld.compact( values, - [\\"https://www.w3.org/ns/activitystreams\\",{\\"sensitive\\":\\"as:sensitive\\",\\"Hashtag\\":\\"as:Hashtag\\"}], + [\\"https://www.w3.org/ns/activitystreams\\",{\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"sensitive\\":\\"as:sensitive\\",\\"Emoji\\":\\"toot:Emoji\\",\\"Hashtag\\":\\"as:Hashtag\\"}], { documentLoader: options.contextLoader }, ); } @@ -22613,7 +22811,7 @@ objects?: (Object | URL)[];} } return await jsonld.compact( values, - [\\"https://www.w3.org/ns/activitystreams\\",{\\"sensitive\\":\\"as:sensitive\\",\\"Hashtag\\":\\"as:Hashtag\\"}], + [\\"https://www.w3.org/ns/activitystreams\\",{\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"sensitive\\":\\"as:sensitive\\",\\"Emoji\\":\\"toot:Emoji\\",\\"Hashtag\\":\\"as:Hashtag\\"}], { documentLoader: options.contextLoader }, ); } diff --git a/federation/handler.test.ts b/federation/handler.test.ts index 0b196f0..fe2cdf7 100644 --- a/federation/handler.test.ts +++ b/federation/handler.test.ts @@ -397,8 +397,10 @@ Deno.test("handleObject()", async () => { "@context": [ "https://www.w3.org/ns/activitystreams", { + Emoji: "toot:Emoji", Hashtag: "as:Hashtag", sensitive: "as:sensitive", + toot: "http://joinmastodon.org/ns#", }, ], id: "https://example.com/users/someone/notes/123", @@ -489,8 +491,10 @@ Deno.test("handleObject()", async () => { "@context": [ "https://www.w3.org/ns/activitystreams", { + Emoji: "toot:Emoji", Hashtag: "as:Hashtag", sensitive: "as:sensitive", + toot: "http://joinmastodon.org/ns#", }, ], id: "https://example.com/users/someone/notes/123", @@ -865,8 +869,10 @@ Deno.test("respondWithObject()", async () => { "@context": [ "https://www.w3.org/ns/activitystreams", { + Emoji: "toot:Emoji", Hashtag: "as:Hashtag", sensitive: "as:sensitive", + toot: "http://joinmastodon.org/ns#", }, ], id: "https://example.com/notes/1", @@ -897,8 +903,10 @@ Deno.test("respondWithObjectIfAcceptable", async () => { "@context": [ "https://www.w3.org/ns/activitystreams", { + Emoji: "toot:Emoji", Hashtag: "as:Hashtag", sensitive: "as:sensitive", + toot: "http://joinmastodon.org/ns#", }, ], id: "https://example.com/notes/1", diff --git a/vocab/__snapshots__/vocab.test.ts.snap b/vocab/__snapshots__/vocab.test.ts.snap index 58ce9d1..f926194 100644 --- a/vocab/__snapshots__/vocab.test.ts.snap +++ b/vocab/__snapshots__/vocab.test.ts.snap @@ -1,5 +1,102 @@ export const snapshot = {}; +snapshot[`Deno.inspect(Emoji) [auto] 1`] = ` +'Emoji { + id: URL "https://example.com/", + attachments: [ Object {}, Link {}, PropertyValue {} ], + attributions: [ Application {}, Group {}, Organization {}, Person {}, Service {} ], + audience: Object {}, + contents: [ "hello", "hello" ], + contexts: [ Object {}, Link {} ], + names: [ "hello", "hello" ], + endTime: 2024-03-03T08:30:06.796196096Z, + generators: [ Object {}, Link {} ], + icon: Image {}, + image: Image {}, + replyTargets: [ Object {}, Link {} ], + locations: [ Object {}, Link {} ], + previews: [ Link {}, Object {} ], + published: 2024-03-03T08:30:06.796196096Z, + replies: Collection {}, + startTime: 2024-03-03T08:30:06.796196096Z, + summaries: [ "hello", "hello" ], + tags: [ Object {}, Link {} ], + updated: 2024-03-03T08:30:06.796196096Z, + urls: [ URL "https://example.com/", Link {} ], + to: Object {}, + bto: Object {}, + cc: Object {}, + bcc: Object {}, + mediaType: "hello", + duration: PT1H, + sensitive: true +}' +`; + +snapshot[`Deno.inspect(Emoji) [auto] 2`] = ` +'Emoji { + attachments: [ URL "https://example.com/" ], + attribution: URL "https://example.com/", + audience: URL "https://example.com/", + contents: [ "hello", "hello" ], + contexts: [ URL "https://example.com/" ], + names: [ "hello", "hello" ], + endTime: 2024-03-03T08:30:06.796196096Z, + generators: [ URL "https://example.com/" ], + icon: URL "https://example.com/", + image: URL "https://example.com/", + replyTarget: URL "https://example.com/", + location: URL "https://example.com/", + preview: URL "https://example.com/", + published: 2024-03-03T08:30:06.796196096Z, + replies: URL "https://example.com/", + startTime: 2024-03-03T08:30:06.796196096Z, + summaries: [ "hello", "hello" ], + tags: [ URL "https://example.com/" ], + updated: 2024-03-03T08:30:06.796196096Z, + urls: [ URL "https://example.com/", Link {} ], + to: URL "https://example.com/", + bto: URL "https://example.com/", + cc: URL "https://example.com/", + bcc: URL "https://example.com/", + mediaType: "hello", + duration: PT1H, + sensitive: true +}' +`; + +snapshot[`Deno.inspect(Emoji) [auto] 3`] = ` +'Emoji { + attachments: [ Object {}, Object {} ], + attributions: [ Application {}, Application {} ], + audiences: [ Object {}, Object {} ], + contents: [ "hello", "hello" ], + contexts: [ Object {}, Object {} ], + names: [ "hello", "hello" ], + endTime: 2024-03-03T08:30:06.796196096Z, + generators: [ Object {}, Object {} ], + icons: [ Image {}, Image {} ], + images: [ Image {}, Image {} ], + replyTargets: [ Object {}, Object {} ], + locations: [ Object {}, Object {} ], + previews: [ Link {}, Link {} ], + published: 2024-03-03T08:30:06.796196096Z, + replies: Collection {}, + startTime: 2024-03-03T08:30:06.796196096Z, + summaries: [ "hello", "hello" ], + tags: [ Object {}, Object {} ], + updated: 2024-03-03T08:30:06.796196096Z, + urls: [ URL "https://example.com/", URL "https://example.com/" ], + tos: [ Object {}, Object {} ], + btos: [ Object {}, Object {} ], + ccs: [ Object {}, Object {} ], + bccs: [ Object {}, Object {} ], + mediaType: "hello", + duration: PT1H, + sensitive: true +}' +`; + snapshot[`Deno.inspect(PropertyValue) [auto] 1`] = `'PropertyValue { id: URL "https://example.com/", name: "hello", value: "hello" }'`; snapshot[`Deno.inspect(PropertyValue) [auto] 2`] = `'PropertyValue { name: "hello", value: "hello" }'`; diff --git a/vocab/announce.yaml b/vocab/announce.yaml index 7555b6d..12ef82f 100644 --- a/vocab/announce.yaml +++ b/vocab/announce.yaml @@ -9,6 +9,8 @@ description: | The `origin` typically has no defined meaning. defaultContext: - "https://www.w3.org/ns/activitystreams" -- sensitive: "as:sensitive" +- toot: "http://joinmastodon.org/ns#" + sensitive: "as:sensitive" + Emoji: "toot:Emoji" Hashtag: "as:Hashtag" properties: [] diff --git a/vocab/article.yaml b/vocab/article.yaml index 73f84f1..631d8bd 100644 --- a/vocab/article.yaml +++ b/vocab/article.yaml @@ -6,6 +6,8 @@ entity: true description: Represents any kind of multi-paragraph written work. defaultContext: - "https://www.w3.org/ns/activitystreams" -- sensitive: "as:sensitive" +- toot: "http://joinmastodon.org/ns#" + sensitive: "as:sensitive" + Emoji: "toot:Emoji" Hashtag: "as:Hashtag" properties: [] diff --git a/vocab/create.yaml b/vocab/create.yaml index 99a066d..c3b279d 100644 --- a/vocab/create.yaml +++ b/vocab/create.yaml @@ -6,6 +6,8 @@ entity: true description: Indicates that the `actor` has created the `object`. defaultContext: - "https://www.w3.org/ns/activitystreams" -- sensitive: "as:sensitive" +- toot: "http://joinmastodon.org/ns#" + sensitive: "as:sensitive" + Emoji: "toot:Emoji" Hashtag: "as:Hashtag" properties: [] diff --git a/vocab/emoji.yaml b/vocab/emoji.yaml new file mode 100644 index 0000000..e99b86f --- /dev/null +++ b/vocab/emoji.yaml @@ -0,0 +1,11 @@ +$schema: ../codegen/schema.yaml +name: Emoji +uri: "http://joinmastodon.org/ns#Emoji" +extends: "https://www.w3.org/ns/activitystreams#Object" +entity: true +description: Represents a custom emoji. +defaultContext: +- "https://www.w3.org/ns/activitystreams" +- toot: "http://joinmastodon.org/ns#" + Emoji: "toot:Emoji" +properties: [] diff --git a/vocab/note.yaml b/vocab/note.yaml index 227b546..def4592 100644 --- a/vocab/note.yaml +++ b/vocab/note.yaml @@ -8,6 +8,8 @@ description: | length. defaultContext: - "https://www.w3.org/ns/activitystreams" -- sensitive: "as:sensitive" +- toot: "http://joinmastodon.org/ns#" + sensitive: "as:sensitive" + Emoji: "toot:Emoji" Hashtag: "as:Hashtag" properties: [] diff --git a/vocab/update.yaml b/vocab/update.yaml index 1ced98f..b23325c 100644 --- a/vocab/update.yaml +++ b/vocab/update.yaml @@ -11,6 +11,8 @@ description: | The `target` and `origin` typically have no defined meaning. defaultContext: - "https://www.w3.org/ns/activitystreams" -- sensitive: "as:sensitive" +- toot: "http://joinmastodon.org/ns#" + sensitive: "as:sensitive" + Emoji: "toot:Emoji" Hashtag: "as:Hashtag" properties: []