Skip to main content
Home

Built and signed on GitHub Actions

Works with
This package works with Node.js, Deno, Bun
This package works with Node.js
This package works with Deno
This package works with Bun
JSR Score94%
Downloads59/wk
Published4 weeks ago (1.10.0)

An ActivityPub/fediverse server framework

class Article
extends Object

Represents any kind of multi-paragraph written work.

Constructors

new
Article(
values: { id?: URL | null; attachments?: ()[]; attribution?: ; attributions?: ()[]; audience?:
Object
| URL
| null
; audiences?: (Object | URL)[]; content?:
string
| LanguageString
| null
; contents?: ((string | LanguageString))[]; contexts?: ()[]; name?:
string
| LanguageString
| null
; names?: ((string | LanguageString))[]; endTime?: Temporal.Instant | null; generators?: ()[]; icon?:
Image
| URL
| null
; icons?: (Image | URL)[]; image?:
Image
| URL
| null
; images?: (Image | URL)[]; replyTarget?:
Object
| Link
| URL
| null
; replyTargets?: ()[]; location?:
Object
| Link
| URL
| null
; locations?: ()[]; preview?:
Link
| Object
| URL
| null
; previews?: ()[]; 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?: ()[]; 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?: ; proofs?: (DataIntegrityProof | URL)[]; quoteUrl?: URL | null; }
,
options?: { documentLoader?: DocumentLoader; contextLoader?: DocumentLoader; tracerProvider?: TracerProvider; },
)

Constructs a new instance of Article with the given values.

Properties

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

[Symbol.for("nodejs.util.inspect.custom")](
_depth: number,
options: unknown,
inspect: (
value: unknown,
options: unknown,
) => string
,
): string
protected
_getCustomInspectProxy(): Record<string, unknown>
clone(
values?: { id?: URL | null; attachments?: ()[]; attribution?: ; attributions?: ()[]; audience?:
Object
| URL
| null
; audiences?: (Object | URL)[]; content?:
string
| LanguageString
| null
; contents?: ((string | LanguageString))[]; contexts?: ()[]; name?:
string
| LanguageString
| null
; names?: ((string | LanguageString))[]; endTime?: Temporal.Instant | null; generators?: ()[]; icon?:
Image
| URL
| null
; icons?: (Image | URL)[]; image?:
Image
| URL
| null
; images?: (Image | URL)[]; replyTarget?:
Object
| Link
| URL
| null
; replyTargets?: ()[]; location?:
Object
| Link
| URL
| null
; locations?: ()[]; preview?:
Link
| Object
| URL
| null
; previews?: ()[]; 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?: ()[]; 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?: ; proofs?: (DataIntegrityProof | URL)[]; quoteUrl?: URL | null; }
,
options?: { documentLoader?: DocumentLoader; contextLoader?: DocumentLoader; },
): Article

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

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.

Static Properties

readonly
typeId: URL

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

Static Methods

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

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

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/fedify

Import symbol

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

Import directly with a jsr specifier

import { Article } from "jsr:@fedify/fedify/vocab";

Add Package

pnpm i jsr:@fedify/fedify
or (using pnpm 10.8 or older)
pnpm dlx jsr add @fedify/fedify

Import symbol

import { Article } from "@fedify/fedify/vocab";

Add Package

yarn add jsr:@fedify/fedify
or (using Yarn 4.8 or older)
yarn dlx jsr add @fedify/fedify

Import symbol

import { Article } from "@fedify/fedify/vocab";

Add Package

vlt install jsr:@fedify/fedify

Import symbol

import { Article } from "@fedify/fedify/vocab";

Add Package

npx jsr add @fedify/fedify

Import symbol

import { Article } from "@fedify/fedify/vocab";

Add Package

bunx jsr add @fedify/fedify

Import symbol

import { Article } from "@fedify/fedify/vocab";