kopia lustrzana https://github.com/activitypub-js/activitypub-models
Extension with Activity Pub (#3)
* rename AS -> AP * add source field * update docs * add actor basic * add Actor types * update types extendingpull/4/head
rodzic
9378cf7015
commit
d290a12498
|
@ -1,10 +1,10 @@
|
|||
import {ASObject} from "../models/asObject/ASObject.model";
|
||||
import {APObject} from "../models/apObject/APObject.model";
|
||||
import {Collection} from "../models/collection/Collection.model";
|
||||
import {OrderedCollection} from "../models/orderedCollection/OrderedCollection.model";
|
||||
import {Article} from "../models/article/Article.model";
|
||||
import {Audio} from "../models/audio/Audio.model";
|
||||
import {Document} from "../models/document/Document.model";
|
||||
import {ASEvent} from "../models/asEvent/ASEvent.model";
|
||||
import {APEvent} from "../models/apEvent/APEvent.model";
|
||||
import {Image} from "../models/image/Image.model";
|
||||
import {Note} from "../models/note/Note.model";
|
||||
import {Page} from "../models/page/Page.model";
|
||||
|
@ -48,7 +48,7 @@ export enum ASModelType {
|
|||
}
|
||||
|
||||
export type AnyCollection = Collection | OrderedCollection;
|
||||
export type AnyASObject = ASObject | Article | Audio | Document | ASEvent | Image | Note | Page | Place | Profile | Relationship | Tombstone | Video | AnyCollection;
|
||||
export type AnyASObject = APObject | Article | Audio | Document | APEvent | Image | Note | Page | Place | Profile | Relationship | Tombstone | Video | AnyCollection;
|
||||
|
||||
export type DateTime = string;
|
||||
export type LanguageTag = string;
|
||||
|
@ -126,3 +126,23 @@ export type OrderedCollectionPagePartOfValue = string | OrderedCollection | Link
|
|||
export type OrderedCollectionPageNextValue = string | OrderedCollection | Link;
|
||||
export type OrderedCollectionPagePrevValue = string | OrderedCollection | Link;
|
||||
export type StartIndexValue = number;
|
||||
export type SourceValue = {
|
||||
content: ContentValue,
|
||||
mediaType?: MediaType,
|
||||
}
|
||||
export type InboxValue = string | OrderedCollection | Link;
|
||||
export type OutboxValue = string | OrderedCollection | Link;
|
||||
export type FollowingValue = string | Collection | OrderedCollection | Link;
|
||||
export type FollowersValue = string | Collection | OrderedCollection | Link;
|
||||
export type LikedValue = string | Collection | OrderedCollection | Link;
|
||||
export type LikesValue = string | Collection | OrderedCollection | Link;
|
||||
export type SharesValue = string | Collection | OrderedCollection | Link;
|
||||
export type StreamsValue = string | Collection | OrderedCollection | Link;
|
||||
export type PreferredUsernameValue = string;
|
||||
export type PreferredUsernameMapValue = Record<string, string>;
|
||||
export type ProxyUrlValue = string;
|
||||
export type OauthAuthorizationEndpointValue = string;
|
||||
export type OauthTokenEndpointValue = string;
|
||||
export type ProvideClientKeyValue = string;
|
||||
export type SignClientKeyValue = string;
|
||||
export type SharedInboxValue = string;
|
|
@ -1,4 +1,4 @@
|
|||
import {ASBase} from "../asBase/ASBase.model";
|
||||
import {APBase} from "../apBase/APBase.model";
|
||||
import { ActivityFields } from "./Activity.types";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
|
||||
|
@ -10,7 +10,7 @@ import {ASModelType} from "../../common/common.types";
|
|||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#Activity Docs}
|
||||
*/
|
||||
export class Activity extends ASBase<ActivityFields>{
|
||||
export class Activity extends APBase<ActivityFields>{
|
||||
constructor(fields: ActivityFields) {
|
||||
super({
|
||||
type: ASModelType.Activity,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {ASObjectFields} from "../asObject/ASObject.types";
|
||||
import {APObjectFields} from "../apObject/APObject.types";
|
||||
import {
|
||||
ActorValue,
|
||||
InstrumentValue,
|
||||
|
@ -8,7 +8,7 @@ import {
|
|||
TargetValue
|
||||
} from "../../common/common.types";
|
||||
|
||||
export interface ActivityFields extends ASObjectFields {
|
||||
export interface ActivityFields extends APObjectFields {
|
||||
|
||||
/**
|
||||
* Describes one or more entities that either performed or are expected to perform the activity.
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
import {APBase} from "../apBase/APBase.model";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {ActorFields} from "./Actor.types";
|
||||
|
||||
/**
|
||||
* ActivityPub actors are generally one of the ActivityStreams Actor Types, but
|
||||
* they don't have to be. For example, a Profile object might be used as an actor,
|
||||
* or a type from an ActivityStreams extension. Actors are retrieved like any other
|
||||
* Object in ActivityPub. Like other ActivityStreams objects, actors have an id,
|
||||
* which is a URI. When entered directly into a user interface (for example on a
|
||||
* login form), it is desirable to support simplified naming.
|
||||
*
|
||||
* {@link https://www.w3.org/TR/activitypub/#actors Docs}
|
||||
*/
|
||||
export class Actor extends APBase<ActorFields>{
|
||||
constructor(fields: ActorFields) {
|
||||
super({
|
||||
type: ASModelType.Profile,
|
||||
...fields
|
||||
})
|
||||
}
|
||||
}
|
|
@ -0,0 +1,177 @@
|
|||
import {APObjectFields} from "../apObject/APObject.types";
|
||||
import {
|
||||
FollowersValue,
|
||||
FollowingValue,
|
||||
InboxValue,
|
||||
LikedValue,
|
||||
OauthAuthorizationEndpointValue,
|
||||
OauthTokenEndpointValue,
|
||||
OutboxValue,
|
||||
PreferredUsernameMapValue,
|
||||
PreferredUsernameValue,
|
||||
ProvideClientKeyValue,
|
||||
ProxyUrlValue, SharedInboxValue,
|
||||
SignClientKeyValue,
|
||||
StreamsValue
|
||||
} from "../../common/common.types";
|
||||
|
||||
export interface EndpointsValue {
|
||||
|
||||
/**
|
||||
* Endpoint URI so this actor's clients may access remote ActivityStreams
|
||||
* objects which require authentication to access. To use this endpoint,
|
||||
* the client posts an x-www-form-urlencoded id parameter with the value
|
||||
* being the id of the requested ActivityStreams object.
|
||||
*
|
||||
* {@link https://www.w3.org/TR/activitypub/#actors Docs}
|
||||
*/
|
||||
proxyUrl?: ProxyUrlValue;
|
||||
|
||||
/**
|
||||
* If OAuth 2.0 bearer tokens [RFC6749] [RFC6750] are being used for authenticating
|
||||
* client to server interactions, this endpoint specifies a URI at which a
|
||||
* browser-authenticated user may obtain a new authorization grant.
|
||||
*
|
||||
* {@link https://www.w3.org/TR/activitypub/#actors Docs}
|
||||
*/
|
||||
oauthAuthorizationEndpoint?: OauthAuthorizationEndpointValue;
|
||||
|
||||
/**
|
||||
* If OAuth 2.0 bearer tokens [RFC6749] [RFC6750] are being used for authenticating
|
||||
* client to server interactions, this endpoint specifies a URI at which a client
|
||||
* may acquire an access token.
|
||||
*
|
||||
* {@link https://www.w3.org/TR/activitypub/#actors Docs}
|
||||
*/
|
||||
oauthTokenEndpoint?: OauthTokenEndpointValue;
|
||||
|
||||
/**
|
||||
* If Linked Data Signatures and HTTP Signatures are being used for authentication
|
||||
* and authorization, this endpoint specifies a URI at which browser-authenticated
|
||||
* users may authorize a client's public key for client to server interactions.
|
||||
*
|
||||
* {@link https://www.w3.org/TR/activitypub/#actors Docs}
|
||||
*/
|
||||
provideClientKey?: ProvideClientKeyValue;
|
||||
|
||||
/**
|
||||
* If Linked Data Signatures and HTTP Signatures are being used for authentication an
|
||||
* authorization, this endpoint specifies a URI at which a client key may be signed
|
||||
* by the actor's key for a time window to act on behalf of the actor in interacting
|
||||
* with foreign servers.
|
||||
*
|
||||
* {@link https://www.w3.org/TR/activitypub/#actors Docs}
|
||||
*/
|
||||
signClientKey?: SignClientKeyValue;
|
||||
|
||||
/**
|
||||
* An optional endpoint used for wide delivery of publicly addressed activities and
|
||||
* activities sent to followers. sharedInbox endpoints SHOULD also be publicly readable
|
||||
* OrderedCollection objects containing objects addressed to the Public special collection.
|
||||
* Reading from the sharedInbox endpoint MUST NOT present objects which are not addressed
|
||||
* to the Public endpoint.
|
||||
*
|
||||
* {@link https://www.w3.org/TR/activitypub/#actors Docs}
|
||||
*/
|
||||
sharedInbox?: SharedInboxValue;
|
||||
}
|
||||
|
||||
export interface ActorFields extends APObjectFields {
|
||||
|
||||
/**
|
||||
* The inbox is discovered through the inbox property of an actor's profile.
|
||||
* The inbox MUST be an OrderedCollection. The inbox stream contains all activities
|
||||
* received by the actor. The server SHOULD filter content according to the
|
||||
* requester permission. In general, the owner of an inbox is likely to be
|
||||
* able to access all of their inbox contents. Depending on access control,
|
||||
* some other content may be public, whereas other content may require
|
||||
* authentication for non-owner users, if they can access the inbox at all.
|
||||
*
|
||||
* {@link https://www.w3.org/TR/activitypub/#inbox Docs}
|
||||
*/
|
||||
inbox: InboxValue;
|
||||
|
||||
/**
|
||||
* The outbox is discovered through the outbox property of an actor's profile.
|
||||
* The outbox MUST be an OrderedCollection. The outbox stream contains activities
|
||||
* the user has published, subject to the ability of the requester to retrieve the
|
||||
* activity (that is, the contents of the outbox are filtered by the permissions
|
||||
* of the person reading it). If a user submits a request without Authorization the
|
||||
* server should respond with all the Public posts. This could potentially be all
|
||||
* relevant objects published by the user, though the number of available items is
|
||||
* left to the discretion of those implementing and deploying the server.
|
||||
*
|
||||
* {@link https://www.w3.org/TR/activitypub/#outbox Docs}
|
||||
*/
|
||||
outbox: OutboxValue;
|
||||
|
||||
/**
|
||||
* Every actor SHOULD have a collection of following. This is a list of everybody that
|
||||
* the actor has followed, added as a side effect. The following collection MUST be
|
||||
* either an OrderedCollection or a Collection and MAY be filtered on privileges of an
|
||||
* authenticated user or as appropriate when no authentication is given.
|
||||
*
|
||||
* {@link https://www.w3.org/TR/activitypub/#following Docs}
|
||||
*/
|
||||
following?: FollowingValue;
|
||||
|
||||
/**
|
||||
* Every actor SHOULD have a collection of followers. This is a list of everyone who has
|
||||
* sent a Follow activity for the actor, added as a side effect. This is where one would
|
||||
* find a list of all the actors that are following the actor. The followers collection
|
||||
* MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges
|
||||
* of an authenticated user or as appropriate when no authentication is given.
|
||||
*
|
||||
* NOTE: The follow activity generally is a request to see the objects an actor creates.
|
||||
* This makes the Followers collection an appropriate default target for delivery of notifications.
|
||||
*
|
||||
* {@link https://www.w3.org/TR/activitypub/#followers Docs}
|
||||
*/
|
||||
followers?: FollowersValue;
|
||||
|
||||
/**
|
||||
* Every actor MAY have a liked collection. This is a list of every object from all the
|
||||
* actor's Like activities, added as a side effect. The liked collection MUST be either
|
||||
* an OrderedCollection or a Collection and MAY be filtered on privileges of an
|
||||
* authenticated user or as appropriate when no authentication is given.
|
||||
*
|
||||
* {@link https://www.w3.org/TR/activitypub/#liked Docs}
|
||||
*/
|
||||
liked?: LikedValue;
|
||||
|
||||
/**
|
||||
* A list of supplementary Collections which may be of interest.
|
||||
*
|
||||
* {@link https://www.w3.org/TR/activitypub/#actors Docs}
|
||||
*/
|
||||
streams?: StreamsValue | StreamsValue[];
|
||||
|
||||
// TODO preferredUsername or preferredUsernameMap at one time
|
||||
|
||||
/**
|
||||
* A short username which may be used to refer to the actor, with no uniqueness guarantees.
|
||||
* [For multiple language-tagged values use preferredUsernameMap property]
|
||||
*
|
||||
* {@link https://www.w3.org/TR/activitypub/#actors Docs}
|
||||
*/
|
||||
preferredUsername?: PreferredUsernameValue;
|
||||
|
||||
/**
|
||||
* A short username which may be used to refer to the actor, with no uniqueness guarantees.
|
||||
* [For a single value use preferredUsername property]
|
||||
*
|
||||
* {@link https://www.w3.org/TR/activitypub/#actors Docs}
|
||||
*/
|
||||
preferredUsernameMap?: PreferredUsernameMapValue;
|
||||
|
||||
/**
|
||||
* A json object which maps additional (typically server/domain-wide) endpoints which may
|
||||
* be useful either for this actor or someone referencing this actor. This mapping may be
|
||||
* nested inside the actor document as the value or may be a link to a JSON-LD document with
|
||||
* these properties.
|
||||
*
|
||||
* {@link https://www.w3.org/TR/activitypub/#actors Docs}
|
||||
*/
|
||||
endpoints?: EndpointsValue;
|
||||
|
||||
}
|
|
@ -8,7 +8,7 @@ export interface ModelBaseAPWithContext {
|
|||
'@context'?: Context;
|
||||
}
|
||||
|
||||
export class ASBase<T> {
|
||||
export class APBase<T> {
|
||||
public fields: T & ModelBaseAPWithContext;
|
||||
|
||||
constructor(fields: T) {
|
||||
|
@ -31,7 +31,7 @@ export class ASBase<T> {
|
|||
public plain(): Record<string, any> {
|
||||
const result = {} as Record<string, any>;
|
||||
for (const [key, node] of Object.entries(this.fields)) {
|
||||
if (node instanceof ASBase) {
|
||||
if (node instanceof APBase) {
|
||||
result[key] = node.plain();
|
||||
} else {
|
||||
result[key] = node;
|
|
@ -1,14 +1,14 @@
|
|||
import {ASBase} from "../asBase/ASBase.model";
|
||||
import {APBase} from "../apBase/APBase.model";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {ASEventFields} from "./ASEvent.types";
|
||||
import {APEventFields} from "./APEvent.types";
|
||||
|
||||
/**
|
||||
* Represents any kind of event
|
||||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#Event Docs}
|
||||
*/
|
||||
export class ASEvent extends ASBase<ASEventFields>{
|
||||
constructor(fields: ASEventFields) {
|
||||
export class APEvent extends APBase<APEventFields>{
|
||||
constructor(fields: APEventFields) {
|
||||
super({
|
||||
type: ASModelType.Event,
|
||||
...fields
|
|
@ -0,0 +1,3 @@
|
|||
import {APObjectFields} from "../apObject/APObject.types";
|
||||
|
||||
export interface APEventFields extends APObjectFields {}
|
|
@ -1,5 +1,5 @@
|
|||
import {ASBase} from "../asBase/ASBase.model";
|
||||
import { ASObjectFields } from "./ASObject.types";
|
||||
import {APBase} from "../apBase/APBase.model";
|
||||
import { APObjectFields } from "./APObject.types";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
|
||||
/**
|
||||
|
@ -9,8 +9,8 @@ import {ASModelType} from "../../common/common.types";
|
|||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#Object Docs}
|
||||
*/
|
||||
export class ASObject extends ASBase<ASObjectFields>{
|
||||
constructor(fields: ASObjectFields) {
|
||||
export class APObject extends APBase<APObjectFields>{
|
||||
constructor(fields: APObjectFields) {
|
||||
super({
|
||||
type: ASModelType.Object,
|
||||
...fields
|
|
@ -28,23 +28,30 @@ import {
|
|||
SummaryValue,
|
||||
SummaryMapValue,
|
||||
UpdatedValue,
|
||||
DurationValue,
|
||||
DurationValue, SourceValue, LikesValue, SharesValue,
|
||||
} from "../../common/common.types";
|
||||
|
||||
export interface ASObjectFields {
|
||||
export interface APObjectFields {
|
||||
/**
|
||||
* Provides the globally unique identifier for
|
||||
* an {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-object Object}
|
||||
* All objects must have unique global identifier (unless the object is transient,
|
||||
* in which case the id MAY be omitted).
|
||||
*
|
||||
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-object Docs (@id)}
|
||||
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-object AS Docs (@id)}
|
||||
*
|
||||
* {@link https://www.w3.org/TR/activitypub/#obj-id AP Docs}
|
||||
*/
|
||||
id?: IdValue;
|
||||
|
||||
/**
|
||||
* Identifies the {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-object Object}
|
||||
* type. Multiple values may be specified.
|
||||
* All objects must have type. There is already a bunch of default types presented by this library.
|
||||
*
|
||||
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-object Docs (@type)}
|
||||
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-object AS Docs (@type)}
|
||||
*
|
||||
* {@link https://www.w3.org/TR/activitypub/#obj-id AP Docs}
|
||||
*/
|
||||
type?: TypeValue | TypeValue[];
|
||||
|
||||
|
@ -80,7 +87,7 @@ export interface ASObjectFields {
|
|||
* The content or textual representation of the Object encoded as a JSON string.
|
||||
* By default, the value of content is HTML. The mediaType property can be
|
||||
* used in the object to indicate a different content type.
|
||||
* [For multiple language-tagged values use contentMap property].
|
||||
* [For multiple language-tagged values use contentMap property]
|
||||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#content Docs}
|
||||
*/
|
||||
|
@ -90,7 +97,7 @@ export interface ASObjectFields {
|
|||
* The content or textual representation of the Object encoded as a JSON string.
|
||||
* By default, the value of content is HTML. The mediaType property can be
|
||||
* used in the object to indicate a different content type.
|
||||
* [For a single value use content property].
|
||||
* [For a single value use content property]
|
||||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#content Docs}
|
||||
*/
|
||||
|
@ -323,4 +330,35 @@ export interface ASObjectFields {
|
|||
* P2Y6M5DT12H35M30S (2 years, 6 months, 5 days, 12 hours, 35 minutes, 30 seconds)
|
||||
*/
|
||||
duration?: DurationValue;
|
||||
|
||||
/**
|
||||
* ActivityPub extends the Object by supplying the source property. The source property is intended to
|
||||
* convey some sort of source from which the content markup was derived, as a form of provenance, or to
|
||||
* support future editing by clients. In general, clients do the conversion from source to content, not
|
||||
* the other way around.
|
||||
* The value of source is itself an object which uses its own content and mediaType fields to supply source information.
|
||||
*
|
||||
* {@link https://www.w3.org/TR/activitypub/#source-property Docs}
|
||||
*/
|
||||
source?: SourceValue;
|
||||
|
||||
/**
|
||||
* Every object MAY have a "likes" collection. This is a list of all Like activities with this object as
|
||||
* the object property, added as a side effect. The likes collection MUST be either an OrderedCollection
|
||||
* or a Collection and MAY be filtered on privileges of an authenticated user or as appropriate when
|
||||
* no authentication is given.
|
||||
*
|
||||
* {@link https://www.w3.org/TR/activitypub/#likes Docs}
|
||||
*/
|
||||
likes?: LikesValue;
|
||||
|
||||
/**
|
||||
* Every object MAY have a "shares" collection. This is a list of all Announce activities with this object as
|
||||
* the object property, added as a side effect. The shares collection MUST be either an OrderedCollection
|
||||
* or a Collection and MAY be filtered on privileges of an authenticated user or as appropriate when
|
||||
* no authentication is given.
|
||||
*
|
||||
* {@link https://www.w3.org/TR/activitypub/#shares Docs}
|
||||
*/
|
||||
shares?: SharesValue;
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
import {ASBase} from "../asBase/ASBase.model";
|
||||
import {APBase} from "../apBase/APBase.model";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {ApplicationFields} from "./Application.types";
|
||||
|
||||
|
@ -7,7 +7,7 @@ import {ApplicationFields} from "./Application.types";
|
|||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#Application Docs}
|
||||
*/
|
||||
export class Application extends ASBase<ApplicationFields>{
|
||||
export class Application extends APBase<ApplicationFields>{
|
||||
constructor(fields: ApplicationFields) {
|
||||
super({
|
||||
type: ASModelType.Application,
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
import {ASObjectFields} from "../asObject/ASObject.types";
|
||||
import {ActorFields} from "../actor/Actor.types";
|
||||
|
||||
export interface ApplicationFields extends ASObjectFields {}
|
||||
export interface ApplicationFields extends ActorFields {}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {ASBase} from "../asBase/ASBase.model";
|
||||
import {APBase} from "../apBase/APBase.model";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {ArticleFields} from "./Article.types";
|
||||
|
||||
|
@ -7,7 +7,7 @@ import {ArticleFields} from "./Article.types";
|
|||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#Article Docs}
|
||||
*/
|
||||
export class Article extends ASBase<ArticleFields>{
|
||||
export class Article extends APBase<ArticleFields>{
|
||||
constructor(fields: ArticleFields) {
|
||||
super({
|
||||
type: ASModelType.Article,
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
import {ASObjectFields} from "../asObject/ASObject.types";
|
||||
import {APObjectFields} from "../apObject/APObject.types";
|
||||
|
||||
export interface ArticleFields extends ASObjectFields {}
|
||||
export interface ArticleFields extends APObjectFields {}
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
import {ASObjectFields} from "../asObject/ASObject.types";
|
||||
|
||||
export interface ASEventFields extends ASObjectFields {}
|
|
@ -1,4 +1,4 @@
|
|||
import {ASBase} from "../asBase/ASBase.model";
|
||||
import {APBase} from "../apBase/APBase.model";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {AudioFields} from "./Audio.types";
|
||||
|
||||
|
@ -7,7 +7,7 @@ import {AudioFields} from "./Audio.types";
|
|||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#Audio Docs}
|
||||
*/
|
||||
export class Audio extends ASBase<AudioFields>{
|
||||
export class Audio extends APBase<AudioFields>{
|
||||
constructor(fields: AudioFields) {
|
||||
super({
|
||||
type: ASModelType.Audio,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {ASBase} from "../asBase/ASBase.model";
|
||||
import {APBase} from "../apBase/APBase.model";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {CollectionFields} from "./Collection.types";
|
||||
|
||||
|
@ -8,7 +8,7 @@ import {CollectionFields} from "./Collection.types";
|
|||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#Collection Docs}
|
||||
*/
|
||||
export class Collection extends ASBase<CollectionFields>{
|
||||
export class Collection extends APBase<CollectionFields>{
|
||||
constructor(fields: CollectionFields) {
|
||||
super({
|
||||
type: ASModelType.Collection,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {ASObjectFields} from "../asObject/ASObject.types";
|
||||
import {APObjectFields} from "../apObject/APObject.types";
|
||||
import {
|
||||
CollectionCurrentValue,
|
||||
CollectionFirstValue, CollectionItemsValue,
|
||||
|
@ -6,7 +6,7 @@ import {
|
|||
TotalItemsValue
|
||||
} from "../../common/common.types";
|
||||
|
||||
export interface CollectionFields extends ASObjectFields {
|
||||
export interface CollectionFields extends APObjectFields {
|
||||
|
||||
/**
|
||||
* A non-negative integer specifying the total number of objects contained by
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {ASBase} from "../asBase/ASBase.model";
|
||||
import {APBase} from "../apBase/APBase.model";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {CollectionPageFields} from "./CollectionPage.types";
|
||||
|
||||
|
@ -7,7 +7,7 @@ import {CollectionPageFields} from "./CollectionPage.types";
|
|||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#CollectionPage Docs}
|
||||
*/
|
||||
export class CollectionPage extends ASBase<CollectionPageFields>{
|
||||
export class CollectionPage extends APBase<CollectionPageFields>{
|
||||
constructor(fields: CollectionPageFields) {
|
||||
super({
|
||||
type: ASModelType.CollectionPage,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {ASBase} from "../asBase/ASBase.model";
|
||||
import {APBase} from "../apBase/APBase.model";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {DocumentFields} from "./Document.types";
|
||||
|
||||
|
@ -7,7 +7,7 @@ import {DocumentFields} from "./Document.types";
|
|||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#Document Docs}
|
||||
*/
|
||||
export class Document extends ASBase<DocumentFields>{
|
||||
export class Document extends APBase<DocumentFields>{
|
||||
constructor(fields: DocumentFields) {
|
||||
super({
|
||||
type: ASModelType.Document,
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
import {ASObjectFields} from "../asObject/ASObject.types";
|
||||
import {APObjectFields} from "../apObject/APObject.types";
|
||||
|
||||
export interface DocumentFields extends ASObjectFields {}
|
||||
export interface DocumentFields extends APObjectFields {}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {ASBase} from "../asBase/ASBase.model";
|
||||
import {APBase} from "../apBase/APBase.model";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {GroupFields} from "./Group.types";
|
||||
|
||||
|
@ -7,7 +7,7 @@ import {GroupFields} from "./Group.types";
|
|||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#Group Docs}
|
||||
*/
|
||||
export class Group extends ASBase<GroupFields>{
|
||||
export class Group extends APBase<GroupFields>{
|
||||
constructor(fields: GroupFields) {
|
||||
super({
|
||||
type: ASModelType.Group,
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
import {ASObjectFields} from "../asObject/ASObject.types";
|
||||
import {ActorFields} from "../actor/Actor.types";
|
||||
|
||||
export interface GroupFields extends ASObjectFields {}
|
||||
export interface GroupFields extends ActorFields {}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {ASBase} from "../asBase/ASBase.model";
|
||||
import {APBase} from "../apBase/APBase.model";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {ImageFields} from "./Image.types";
|
||||
|
||||
|
@ -7,7 +7,7 @@ import {ImageFields} from "./Image.types";
|
|||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#Image Docs}
|
||||
*/
|
||||
export class Image extends ASBase<ImageFields>{
|
||||
export class Image extends APBase<ImageFields>{
|
||||
constructor(fields: ImageFields) {
|
||||
super({
|
||||
type: ASModelType.Image,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {ASBase} from "../asBase/ASBase.model";
|
||||
import {APBase} from "../apBase/APBase.model";
|
||||
import {IntransitiveActivityFields} from './IntransitiveActivity.types';
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
|
||||
|
@ -9,7 +9,7 @@ import {ASModelType} from "../../common/common.types";
|
|||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#IntransitiveActivity Docs}
|
||||
*/
|
||||
export class IntransitiveActivity extends ASBase<IntransitiveActivityFields>{
|
||||
export class IntransitiveActivity extends APBase<IntransitiveActivityFields>{
|
||||
constructor(fields: IntransitiveActivityFields) {
|
||||
super({
|
||||
type: ASModelType.Activity,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {ASBase} from "../asBase/ASBase.model";
|
||||
import {APBase} from "../apBase/APBase.model";
|
||||
import { LinkFields } from "./Link.types";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
|
||||
|
@ -12,7 +12,7 @@ import {ASModelType} from "../../common/common.types";
|
|||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#Link Docs}
|
||||
*/
|
||||
export class Link extends ASBase<LinkFields>{
|
||||
export class Link extends APBase<LinkFields>{
|
||||
constructor(fields: LinkFields) {
|
||||
super({
|
||||
type: ASModelType.Link,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {ASBase} from "../asBase/ASBase.model";
|
||||
import {APBase} from "../apBase/APBase.model";
|
||||
import {MentionFields} from "./Mention.types";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
/**
|
||||
|
@ -6,7 +6,7 @@ import {ASModelType} from "../../common/common.types";
|
|||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#Mention Docs}
|
||||
*/
|
||||
export class Mention extends ASBase<MentionFields>{
|
||||
export class Mention extends APBase<MentionFields>{
|
||||
constructor(fields: MentionFields) {
|
||||
super({
|
||||
type: ASModelType.Mention,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {ASBase} from "../asBase/ASBase.model";
|
||||
import {APBase} from "../apBase/APBase.model";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {NoteFields} from "./Note.types";
|
||||
|
||||
|
@ -7,7 +7,7 @@ import {NoteFields} from "./Note.types";
|
|||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#Note Docs}
|
||||
*/
|
||||
export class Note extends ASBase<NoteFields>{
|
||||
export class Note extends APBase<NoteFields>{
|
||||
constructor(fields: NoteFields) {
|
||||
super({
|
||||
type: ASModelType.Note,
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
import {ASObjectFields} from "../asObject/ASObject.types";
|
||||
import {APObjectFields} from "../apObject/APObject.types";
|
||||
|
||||
export interface NoteFields extends ASObjectFields {}
|
||||
export interface NoteFields extends APObjectFields {}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {ASBase} from "../asBase/ASBase.model";
|
||||
import {APBase} from "../apBase/APBase.model";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {OrderedCollectionFields} from "./OrderedCollection.types";
|
||||
|
||||
|
@ -8,7 +8,7 @@ import {OrderedCollectionFields} from "./OrderedCollection.types";
|
|||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#OrderedCollection Docs}
|
||||
*/
|
||||
export class OrderedCollection extends ASBase<OrderedCollectionFields>{
|
||||
export class OrderedCollection extends APBase<OrderedCollectionFields>{
|
||||
constructor(fields: OrderedCollectionFields) {
|
||||
super({
|
||||
type: ASModelType.OrderedCollection,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {ASBase} from "../asBase/ASBase.model";
|
||||
import {APBase} from "../apBase/APBase.model";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {OrderedCollectionPageFields} from "./OrderedCollectionPage.types";
|
||||
|
||||
|
@ -7,7 +7,7 @@ import {OrderedCollectionPageFields} from "./OrderedCollectionPage.types";
|
|||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#OrderedCollectionPage Docs}
|
||||
*/
|
||||
export class OrderedCollectionPage extends ASBase<OrderedCollectionPageFields>{
|
||||
export class OrderedCollectionPage extends APBase<OrderedCollectionPageFields>{
|
||||
constructor(fields: OrderedCollectionPageFields) {
|
||||
super({
|
||||
type: ASModelType.OrderedCollectionPage,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {ASBase} from "../asBase/ASBase.model";
|
||||
import {APBase} from "../apBase/APBase.model";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {OrganizationFields} from "./Organization.types";
|
||||
|
||||
|
@ -7,7 +7,7 @@ import {OrganizationFields} from "./Organization.types";
|
|||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#Organization Docs}
|
||||
*/
|
||||
export class Organization extends ASBase<OrganizationFields>{
|
||||
export class Organization extends APBase<OrganizationFields>{
|
||||
constructor(fields: OrganizationFields) {
|
||||
super({
|
||||
type: ASModelType.Organization,
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
import {ASObjectFields} from "../asObject/ASObject.types";
|
||||
import {ActorFields} from "../actor/Actor.types";
|
||||
|
||||
export interface OrganizationFields extends ASObjectFields {}
|
||||
export interface OrganizationFields extends ActorFields {}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {ASBase} from "../asBase/ASBase.model";
|
||||
import {APBase} from "../apBase/APBase.model";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {PageFields} from "./Page.types";
|
||||
|
||||
|
@ -7,7 +7,7 @@ import {PageFields} from "./Page.types";
|
|||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#Page Docs}
|
||||
*/
|
||||
export class Page extends ASBase<PageFields>{
|
||||
export class Page extends APBase<PageFields>{
|
||||
constructor(fields: PageFields) {
|
||||
super({
|
||||
type: ASModelType.Page,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {ASBase} from "../asBase/ASBase.model";
|
||||
import {APBase} from "../apBase/APBase.model";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {PersonFields} from "./Person.types";
|
||||
|
||||
|
@ -7,7 +7,7 @@ import {PersonFields} from "./Person.types";
|
|||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#Person Docs}
|
||||
*/
|
||||
export class Person extends ASBase<PersonFields>{
|
||||
export class Person extends APBase<PersonFields>{
|
||||
constructor(fields: PersonFields) {
|
||||
super({
|
||||
type: ASModelType.Person,
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
import {ASObjectFields} from "../asObject/ASObject.types";
|
||||
import {ActorFields} from "../actor/Actor.types";
|
||||
|
||||
export interface PersonFields extends ASObjectFields {}
|
||||
export interface PersonFields extends ActorFields {}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {ASBase} from "../asBase/ASBase.model";
|
||||
import {APBase} from "../apBase/APBase.model";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {PlaceFields} from "./Place.types";
|
||||
|
||||
|
@ -9,7 +9,7 @@ import {PlaceFields} from "./Place.types";
|
|||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#Place Docs}
|
||||
*/
|
||||
export class Place extends ASBase<PlaceFields>{
|
||||
export class Place extends APBase<PlaceFields>{
|
||||
constructor(fields: PlaceFields) {
|
||||
super({
|
||||
type: ASModelType.Place,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {ASObjectFields} from "../asObject/ASObject.types";
|
||||
import {APObjectFields} from "../apObject/APObject.types";
|
||||
import {
|
||||
AccuracyValue,
|
||||
AltitudeValue,
|
||||
|
@ -9,7 +9,7 @@ import {
|
|||
} from "../../common/common.types";
|
||||
|
||||
|
||||
export interface PlaceFields extends ASObjectFields {
|
||||
export interface PlaceFields extends APObjectFields {
|
||||
|
||||
/**
|
||||
* Indicates the accuracy of position coordinates on a Place objects.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {ASBase} from "../asBase/ASBase.model";
|
||||
import {APBase} from "../apBase/APBase.model";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {ProfileFields} from "./Profile.types";
|
||||
|
||||
|
@ -9,7 +9,7 @@ import {ProfileFields} from "./Profile.types";
|
|||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#Profile Docs}
|
||||
*/
|
||||
export class Profile extends ASBase<ProfileFields>{
|
||||
export class Profile extends APBase<ProfileFields>{
|
||||
constructor(fields: ProfileFields) {
|
||||
super({
|
||||
type: ASModelType.Profile,
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
import {ASObjectFields} from "../asObject/ASObject.types";
|
||||
import {APObjectFields} from "../apObject/APObject.types";
|
||||
import {DescribesValue} from "../../common/common.types";
|
||||
|
||||
export interface ProfileFields extends ASObjectFields {
|
||||
export interface ProfileFields extends APObjectFields {
|
||||
|
||||
/**
|
||||
* On a Profile object, the describes property identifies
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {ASBase} from "../asBase/ASBase.model";
|
||||
import {APBase} from "../apBase/APBase.model";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {QuestionFields} from "./Question.types";
|
||||
|
||||
|
@ -13,7 +13,7 @@ import {QuestionFields} from "./Question.types";
|
|||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#Question Docs}
|
||||
*/
|
||||
export class Question extends ASBase<QuestionFields>{
|
||||
export class Question extends APBase<QuestionFields>{
|
||||
constructor(fields: QuestionFields) {
|
||||
super({
|
||||
type: ASModelType.Question,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {ASBase} from "../asBase/ASBase.model";
|
||||
import {APBase} from "../apBase/APBase.model";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {RelationshipFields} from "./Relationship.types";
|
||||
|
||||
|
@ -10,7 +10,7 @@ import {RelationshipFields} from "./Relationship.types";
|
|||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#Relationship Docs}
|
||||
*/
|
||||
export class Relationship extends ASBase<RelationshipFields>{
|
||||
export class Relationship extends APBase<RelationshipFields>{
|
||||
constructor(fields: RelationshipFields) {
|
||||
super({
|
||||
type: ASModelType.Relationship,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {ASObjectFields} from "../asObject/ASObject.types";
|
||||
import {APObjectFields} from "../apObject/APObject.types";
|
||||
import {SubjectValue, ObjectValue, RelationshipValue} from "../../common/common.types";
|
||||
|
||||
export interface RelationshipFields extends ASObjectFields {
|
||||
export interface RelationshipFields extends APObjectFields {
|
||||
|
||||
/**
|
||||
* On a Relationship object, the subject property identifies one of the connected individuals.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {ASBase} from "../asBase/ASBase.model";
|
||||
import {APBase} from "../apBase/APBase.model";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {ServiceFields} from "./Service.types";
|
||||
|
||||
|
@ -7,7 +7,7 @@ import {ServiceFields} from "./Service.types";
|
|||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#Service Docs}
|
||||
*/
|
||||
export class Service extends ASBase<ServiceFields>{
|
||||
export class Service extends APBase<ServiceFields>{
|
||||
constructor(fields: ServiceFields) {
|
||||
super({
|
||||
type: ASModelType.Service,
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
import {ASObjectFields} from "../asObject/ASObject.types";
|
||||
import {ActorFields} from "../actor/Actor.types";
|
||||
|
||||
export interface ServiceFields extends ASObjectFields {}
|
||||
export interface ServiceFields extends ActorFields {}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {ASBase} from "../asBase/ASBase.model";
|
||||
import {APBase} from "../apBase/APBase.model";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {TombstoneFields} from "./Tombstone.types";
|
||||
|
||||
|
@ -9,7 +9,7 @@ import {TombstoneFields} from "./Tombstone.types";
|
|||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#Tombstone Docs}
|
||||
*/
|
||||
export class Tombstone extends ASBase<TombstoneFields>{
|
||||
export class Tombstone extends APBase<TombstoneFields>{
|
||||
constructor(fields: TombstoneFields) {
|
||||
super({
|
||||
type: ASModelType.Tombstone,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {DeletedValue, FormerTypeValue} from "../../common/common.types";
|
||||
import {ASObjectFields} from "../asObject/ASObject.types";
|
||||
import {APObjectFields} from "../apObject/APObject.types";
|
||||
|
||||
export interface TombstoneFields extends ASObjectFields {
|
||||
export interface TombstoneFields extends APObjectFields {
|
||||
|
||||
/**
|
||||
* On a Tombstone object, the formerType property identifies
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {ASBase} from "../asBase/ASBase.model";
|
||||
import {APBase} from "../apBase/APBase.model";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {VideoFields} from "./Video.types";
|
||||
|
||||
|
@ -7,7 +7,7 @@ import {VideoFields} from "./Video.types";
|
|||
*
|
||||
* {@link https://www.w3.org/ns/activitystreams#Video Docs}
|
||||
*/
|
||||
export class Video extends ASBase<VideoFields>{
|
||||
export class Video extends APBase<VideoFields>{
|
||||
constructor(fields: VideoFields) {
|
||||
super({
|
||||
type: ASModelType.Video,
|
||||
|
|
Ładowanie…
Reference in New Issue