Skip to main content

Built and signed on GitHub Actions

Works with
This package works with Cloudflare Workers, Node.js, Deno, Bun
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
•JSR Score100%•
License
MIT
•
Downloads461/wk
•
Publisheda day ago (2.4.2)

Vocabularies library for Fedify

class Note
extends Object

Represents a short written work typically less than a single paragraph in length.

Constructors

new Note(
values: { id?: URL | null; attachments?: (Object | Link | PropertyValue | URL)[]; attribution?: ; attributions?: (Application | Group | Organization | Person | Service | URL)[]; audience?: Object | URL | null; audiences?: (Object | URL)[]; content?: string | LanguageString | null; contents?: ((string | LanguageString))[]; contexts?: (Object | Link | URL)[]; name?: string | LanguageString | null; names?: ((string | LanguageString))[]; endTime?: Temporal.Instant | null; generators?: (Object | Link | URL)[]; icon?: Image | URL | null; icons?: (Image | URL)[]; image?: Image | URL | null; images?: (Image | URL)[]; replyTarget?: Object | Link | URL | null; replyTargets?: (Object | Link | URL)[]; location?: Object | Link | URL | null; locations?: (Object | Link | URL)[]; preview?: Link | Object | URL | null; previews?: (Link | Object | URL)[]; published?: Temporal.Instant | null; replies?: Collection | URL | null; shares?: Collection | URL | null; likes?: Collection | URL | null; emojiReactions?: Collection | URL | null; startTime?: Temporal.Instant | null; summary?: string | LanguageString | null; summaries?: ((string | LanguageString))[]; tags?: (Object | Link | URL)[]; updated?: Temporal.Instant | null; url?: URL | Link | null; urls?: ((URL | Link))[]; to?: Object | URL | null; tos?: (Object | URL)[]; bto?: Object | URL | null; btos?: (Object | URL)[]; cc?: Object | URL | null; ccs?: (Object | URL)[]; bcc?: Object | URL | null; bccs?: (Object | URL)[]; mediaType?: string | null; duration?: Temporal.Duration | null; sensitive?: boolean | null; source?: Source | null; proof?: DataIntegrityProof | URL | null; proofs?: (DataIntegrityProof | URL)[]; interactionPolicy?: InteractionPolicy | null; approvedBy?: URL | null; likeAuthorization?: LikeAuthorization | URL | null; replyAuthorization?: ReplyAuthorization | URL | null; announceAuthorization?: AnnounceAuthorization | URL | null; translations?: (Translation)[]; quote?: Object | URL | null; quoteUrl?: URL | null; quoteAuthorization?: QuoteAuthorization | URL | null; },
options?: { documentLoader?: DocumentLoader; contextLoader?: DocumentLoader; tracerProvider?: TracerProvider; verifyPortableObject?: PortableObjectVerifier; }
)

Constructs a new instance of Note with the given values.

Parameters
values: { id?: URL | null; attachments?: (Object | Link | PropertyValue | URL)[]; attribution?: ; attributions?: (Application | Group | Organization | Person | Service | URL)[]; audience?: Object | URL | null; audiences?: (Object | URL)[]; content?: string | LanguageString | null; contents?: ((string | LanguageString))[]; contexts?: (Object | Link | URL)[]; name?: string | LanguageString | null; names?: ((string | LanguageString))[]; endTime?: Temporal.Instant | null; generators?: (Object | Link | URL)[]; icon?: Image | URL | null; icons?: (Image | URL)[]; image?: Image | URL | null; images?: (Image | URL)[]; replyTarget?: Object | Link | URL | null; replyTargets?: (Object | Link | URL)[]; location?: Object | Link | URL | null; locations?: (Object | Link | URL)[]; preview?: Link | Object | URL | null; previews?: (Link | Object | URL)[]; published?: Temporal.Instant | null; replies?: Collection | URL | null; shares?: Collection | URL | null; likes?: Collection | URL | null; emojiReactions?: Collection | URL | null; startTime?: Temporal.Instant | null; summary?: string | LanguageString | null; summaries?: ((string | LanguageString))[]; tags?: (Object | Link | URL)[]; updated?: Temporal.Instant | null; url?: URL | Link | null; urls?: ((URL | Link))[]; to?: Object | URL | null; tos?: (Object | URL)[]; bto?: Object | URL | null; btos?: (Object | URL)[]; cc?: Object | URL | null; ccs?: (Object | URL)[]; bcc?: Object | URL | null; bccs?: (Object | URL)[]; mediaType?: string | null; duration?: Temporal.Duration | null; sensitive?: boolean | null; source?: Source | null; proof?: DataIntegrityProof | URL | null; proofs?: (DataIntegrityProof | URL)[]; interactionPolicy?: InteractionPolicy | null; approvedBy?: URL | null; likeAuthorization?: LikeAuthorization | URL | null; replyAuthorization?: ReplyAuthorization | URL | null; announceAuthorization?: AnnounceAuthorization | URL | null; translations?: (Translation)[]; quote?: Object | URL | null; quoteUrl?: URL | null; quoteAuthorization?: QuoteAuthorization | URL | null; }

The values to initialize the instance with.

optional
options: { documentLoader?: DocumentLoader; contextLoader?: DocumentLoader; tracerProvider?: TracerProvider; verifyPortableObject?: PortableObjectVerifier; }

The options to use for initialization.

Static Properties

The type URI of Note: https://www.w3.org/ns/activitystreams#Note.

Static Methods

protected
__fromJsonLd__Note__(
json: unknown,
span: Span,
options?: { documentLoader?: DocumentLoader; contextLoader?: DocumentLoader; tracerProvider?: TracerProvider; verifyPortableObject?: PortableObjectVerifier; baseUrl?: URL; }
): Promise<Note>
fromJsonLd(
json: unknown,
options?: { documentLoader?: DocumentLoader; contextLoader?: DocumentLoader; tracerProvider?: TracerProvider; verifyPortableObject?: PortableObjectVerifier; baseUrl?: URL; }
): Promise<Note>

Converts a JSON-LD structure to an object of this type.

Properties

Similar to Note.getQuoteAuthorization, but returns its @id URL instead of the object itself.

readonly
quoteId: URL | null

Similar to Note.getQuote, but returns its @id URL instead of the object itself.

readonly
quoteUrl: URL | null

The URI of the ActivityStreams object that this object quotes.

This property sets three JSON-LD properties at once under the hood:

  1. https://www.w3.org/ns/activitystreams#quoteUrl
  2. https://misskey-hub.net/ns#_misskey_quote
  3. http://fedibird.com/ns#quoteUri

When a JSON-LD object is parsed, this property is filled with one of the values of those three properties in order.

Methods

protected
_getCustomInspectProxy(): Record<string, unknown>
clone(
values?: { id?: URL | null; attachments?: (Object | Link | PropertyValue | URL)[]; attribution?: ; attributions?: (Application | Group | Organization | Person | Service | URL)[]; audience?: Object | URL | null; audiences?: (Object | URL)[]; content?: string | LanguageString | null; contents?: ((string | LanguageString))[]; contexts?: (Object | Link | URL)[]; name?: string | LanguageString | null; names?: ((string | LanguageString))[]; endTime?: Temporal.Instant | null; generators?: (Object | Link | URL)[]; icon?: Image | URL | null; icons?: (Image | URL)[]; image?: Image | URL | null; images?: (Image | URL)[]; replyTarget?: Object | Link | URL | null; replyTargets?: (Object | Link | URL)[]; location?: Object | Link | URL | null; locations?: (Object | Link | URL)[]; preview?: Link | Object | URL | null; previews?: (Link | Object | URL)[]; published?: Temporal.Instant | null; replies?: Collection | URL | null; shares?: Collection | URL | null; likes?: Collection | URL | null; emojiReactions?: Collection | URL | null; startTime?: Temporal.Instant | null; summary?: string | LanguageString | null; summaries?: ((string | LanguageString))[]; tags?: (Object | Link | URL)[]; updated?: Temporal.Instant | null; url?: URL | Link | null; urls?: ((URL | Link))[]; to?: Object | URL | null; tos?: (Object | URL)[]; bto?: Object | URL | null; btos?: (Object | URL)[]; cc?: Object | URL | null; ccs?: (Object | URL)[]; bcc?: Object | URL | null; bccs?: (Object | URL)[]; mediaType?: string | null; duration?: Temporal.Duration | null; sensitive?: boolean | null; source?: Source | null; proof?: DataIntegrityProof | URL | null; proofs?: (DataIntegrityProof | URL)[]; interactionPolicy?: InteractionPolicy | null; approvedBy?: URL | null; likeAuthorization?: LikeAuthorization | URL | null; replyAuthorization?: ReplyAuthorization | URL | null; announceAuthorization?: AnnounceAuthorization | URL | null; translations?: (Translation)[]; quote?: Object | URL | null; quoteUrl?: URL | null; quoteAuthorization?: QuoteAuthorization | URL | null; },
options?: { documentLoader?: DocumentLoader; contextLoader?: DocumentLoader; verifyPortableObject?: PortableObjectVerifier; }
): Note

Clones this instance, optionally updating it with the given values.

This is a shallow copy: property arrays are copied, but nested objects and URLs are shared with this instance. Dereferencing accessors can cache fetched objects in the instance whose accessor is called. Hydrating a shared nested object through the clone can affect the original as well, and can change JSON-LD output when either is embedded in another object. Hydrating a top-level property of the clone does not update this instance's property.

To resolve properties without sharing nested objects, serialize and re-parse the instance before hydration rather than using this method. See the vocabulary manual for details, including how cached JSON-LD affects serialization.

A clone never inherits a signed JSON-LD representation retained by signObject(): the clone may differ from the document that the proof covers, so embedding the original secured JSON in a parent document would be wrong. Sign the clone again if it has to be embedded as a secured child.

getQuote(options?: { documentLoader?: DocumentLoader; contextLoader?: DocumentLoader; suppressError?: boolean; tracerProvider?: TracerProvider; crossOrigin?: "ignore" | "throw" | "trust"; gateways?: readonly (string | URL)[]; verifyPortableObject?: PortableObjectVerifier; inheritPortableObjectVerifier?: boolean; }): Promise<Object | null>

The quoted ActivityStreams object.

This property is serialized as an IRI-valued JSON-LD property.

getQuoteAuthorization(options?: { documentLoader?: DocumentLoader; contextLoader?: DocumentLoader; suppressError?: boolean; tracerProvider?: TracerProvider; crossOrigin?: "ignore" | "throw" | "trust"; gateways?: readonly (string | URL)[]; verifyPortableObject?: PortableObjectVerifier; inheritPortableObjectVerifier?: boolean; }): Promise<QuoteAuthorization | null>

A QuoteAuthorization object that proves this quote was approved by the quoted object's author.

toJsonLd(options?: { format?: "compact" | "expand"; contextLoader?: DocumentLoader; context?:
string
| Record<string, string>
| (string | Record<string, string>)[]
; }
): Promise<unknown>

Converts this object to a JSON-LD structure.

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@fedify/vocab

Import symbol

import { Note } from "@fedify/vocab";
or

Import directly with a jsr specifier

import { Note } from "jsr:@fedify/vocab@^2.4.2";