kopia lustrzana https://github.com/activitypub-js/activitypub-models
Add Mention types and fix Link
rodzic
ab23e4d17a
commit
84a8dc7396
|
@ -22,6 +22,7 @@ export enum ASModelType {
|
||||||
Tombstone = 'Tombstone',
|
Tombstone = 'Tombstone',
|
||||||
Profile = 'Profile',
|
Profile = 'Profile',
|
||||||
Link = 'Link',
|
Link = 'Link',
|
||||||
|
Mention = 'Mention',
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: implement
|
// TODO: implement
|
||||||
|
|
|
@ -2,6 +2,16 @@ import {ASBase} from "../asBase/ASBase.model";
|
||||||
import { LinkFields } from "./Link.types";
|
import { LinkFields } from "./Link.types";
|
||||||
import {ASModelType} from "../../common/common.types";
|
import {ASModelType} from "../../common/common.types";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A Link is an indirect, qualified reference to a resource identified by a URL.
|
||||||
|
* The fundamental model for links is established by [RFC5988]. Many of the properties
|
||||||
|
* defined by the Activity Vocabulary allow values that are either instances of Object
|
||||||
|
* or Link. When a Link is used, it establishes a qualified relation connecting the
|
||||||
|
* subject (the containing object) to the resource identified by the href. Properties
|
||||||
|
* of the Link are properties of the reference as opposed to properties of the resource.
|
||||||
|
*
|
||||||
|
* {@link https://www.w3.org/ns/activitystreams#Link Docs}
|
||||||
|
*/
|
||||||
export class Link extends ASBase<LinkFields>{
|
export class Link extends ASBase<LinkFields>{
|
||||||
constructor(fields: LinkFields) {
|
constructor(fields: LinkFields) {
|
||||||
super({
|
super({
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
import {ASBase} from "../asBase/ASBase.model";
|
||||||
|
import {MentionFields} from "./Mention.types";
|
||||||
|
import {ASModelType} from "../../common/common.types";
|
||||||
|
/**
|
||||||
|
* A specialized Link that represents an @mention.
|
||||||
|
*
|
||||||
|
* {@link https://www.w3.org/ns/activitystreams#Mention Docs}
|
||||||
|
*/
|
||||||
|
export class Mention extends ASBase<MentionFields>{
|
||||||
|
constructor(fields: MentionFields) {
|
||||||
|
super({
|
||||||
|
type: ASModelType.Mention,
|
||||||
|
...fields
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
import {LinkFields} from "../link/Link.types";
|
||||||
|
|
||||||
|
export interface MentionFields extends LinkFields {}
|
Ładowanie…
Reference in New Issue