kopia lustrzana https://github.com/activitypub-js/activitypub-models
add Article, Document, Event, Group and Note types
rodzic
8452c4caa9
commit
5ab5081956
|
@ -1,10 +1,15 @@
|
|||
import { Link } from "../models/Link.model";
|
||||
import {ASObject} from "../models/asObject/ASObject.model";
|
||||
|
||||
export enum ModelType {
|
||||
export enum ASModelType {
|
||||
Object = 'Object',
|
||||
Activity = 'Activity',
|
||||
Application = 'Application',
|
||||
Article = 'Article',
|
||||
Document = 'Document',
|
||||
Event = 'Event',
|
||||
Group = 'Group',
|
||||
Note = 'Note',
|
||||
}
|
||||
|
||||
// TODO: implement
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {ASBase} from "../ASBase.model";
|
||||
import { ActivityFields } from "./Activity.types";
|
||||
import {ModelType} from "../../common/common.types";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
|
||||
/**
|
||||
* An Activity is a subtype of Object that describes some form of action that may happen,
|
||||
|
@ -12,6 +12,6 @@ import {ModelType} from "../../common/common.types";
|
|||
*/
|
||||
export class Activity extends ASBase<ActivityFields>{
|
||||
constructor(fields: ActivityFields) {
|
||||
super(ModelType.Activity, fields);
|
||||
super(ASModelType.Activity, fields);
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
import {ASBase} from "../ASBase.model";
|
||||
import {ModelType} from "../../common/common.types";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {ApplicationFields} from "./Application.types";
|
||||
|
||||
/**
|
||||
|
@ -9,6 +9,6 @@ import {ApplicationFields} from "./Application.types";
|
|||
*/
|
||||
export class Application extends ASBase<ApplicationFields>{
|
||||
constructor(fields: ApplicationFields) {
|
||||
super(ModelType.Application, fields);
|
||||
super(ASModelType.Application, fields);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
import {ASBase} from "../ASBase.model";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {ArticleFields} from "./Article.types";
|
||||
|
||||
/**
|
||||
* Represents any kind of multi-paragraph written work
|
||||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#Article Docs}
|
||||
*/
|
||||
export class Article extends ASBase<ArticleFields>{
|
||||
constructor(fields: ArticleFields) {
|
||||
super(ASModelType.Article, fields);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
import {ASObjectFields} from "../asObject/ASObject.types";
|
||||
|
||||
export interface ArticleFields extends ASObjectFields {}
|
|
@ -0,0 +1,14 @@
|
|||
import {ASBase} from "../ASBase.model";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {ASEventFields} from "./ASEvent.types";
|
||||
|
||||
/**
|
||||
* Represents any kind of event
|
||||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#Event Docs}
|
||||
*/
|
||||
export class ASEvent extends ASBase<ASEventFields>{
|
||||
constructor(fields: ASEventFields) {
|
||||
super(ASModelType.Event, fields);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
import {ASObjectFields} from "../asObject/ASObject.types";
|
||||
|
||||
export interface ASEventFields extends ASObjectFields {}
|
|
@ -1,6 +1,6 @@
|
|||
import {ASBase} from "../ASBase.model";
|
||||
import { ASObjectFields } from "./ASObject.types";
|
||||
import {ModelType} from "../../common/common.types";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
|
||||
/**
|
||||
* Describes an object of any kind. The Object type serves as the base type for most of
|
||||
|
@ -11,6 +11,6 @@ import {ModelType} from "../../common/common.types";
|
|||
*/
|
||||
export class ASObject extends ASBase<ASObjectFields>{
|
||||
constructor(fields: ASObjectFields) {
|
||||
super(ModelType.Object, fields);
|
||||
super(ASModelType.Object, fields);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
import {ASBase} from "../ASBase.model";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {DocumentFields} from "./Document.types";
|
||||
|
||||
/**
|
||||
* Represents a document of any kind
|
||||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#Document Docs}
|
||||
*/
|
||||
export class Document extends ASBase<DocumentFields>{
|
||||
constructor(fields: DocumentFields) {
|
||||
super(ASModelType.Document, fields);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
import {ASObjectFields} from "../asObject/ASObject.types";
|
||||
|
||||
export interface DocumentFields extends ASObjectFields {}
|
|
@ -0,0 +1,14 @@
|
|||
import {ASBase} from "../ASBase.model";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {GroupFields} from "./Group.types";
|
||||
|
||||
/**
|
||||
* Represents a formal or informal collective of Actors
|
||||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#Group Docs}
|
||||
*/
|
||||
export class Group extends ASBase<GroupFields>{
|
||||
constructor(fields: GroupFields) {
|
||||
super(ASModelType.Group, fields);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
import {ASObjectFields} from "../asObject/ASObject.types";
|
||||
|
||||
export interface GroupFields extends ASObjectFields {}
|
|
@ -1,6 +1,6 @@
|
|||
import {ASBase} from "../ASBase.model";
|
||||
import {IntransitiveActivityFields} from './IntransitiveActivity.types';
|
||||
import {ModelType} from "../../common/common.types";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
|
||||
/**
|
||||
* Instances of intransitiveActivity are a subtype of
|
||||
|
@ -11,6 +11,6 @@ import {ModelType} from "../../common/common.types";
|
|||
*/
|
||||
export class IntransitiveActivity extends ASBase<IntransitiveActivityFields>{
|
||||
constructor(fields: IntransitiveActivityFields) {
|
||||
super(ModelType.Activity, fields);
|
||||
super(ASModelType.Activity, fields);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
import {ASBase} from "../ASBase.model";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {NoteFields} from "./Note.types";
|
||||
|
||||
/**
|
||||
* Represents a short written work typically less than a single paragraph in length.
|
||||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#Note Docs}
|
||||
*/
|
||||
export class Note extends ASBase<NoteFields>{
|
||||
constructor(fields: NoteFields) {
|
||||
super(ASModelType.Note, fields);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
import {ASObjectFields} from "../asObject/ASObject.types";
|
||||
|
||||
export interface NoteFields extends ASObjectFields {}
|
Ładowanie…
Reference in New Issue