diff --git a/src/common/common.types.ts b/src/common/common.types.ts index 961201b..abaac84 100644 --- a/src/common/common.types.ts +++ b/src/common/common.types.ts @@ -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; @@ -125,4 +125,24 @@ export type OrderedCollectionItemsValue = string | OrderedCollectionPage | Link; export type OrderedCollectionPagePartOfValue = string | OrderedCollection | Link; export type OrderedCollectionPageNextValue = string | OrderedCollection | Link; export type OrderedCollectionPagePrevValue = string | OrderedCollection | Link; -export type StartIndexValue = number; \ No newline at end of file +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; +export type ProxyUrlValue = string; +export type OauthAuthorizationEndpointValue = string; +export type OauthTokenEndpointValue = string; +export type ProvideClientKeyValue = string; +export type SignClientKeyValue = string; +export type SharedInboxValue = string; \ No newline at end of file diff --git a/src/models/activity/Activity.model.ts b/src/models/activity/Activity.model.ts index fad669b..7e2ab6d 100644 --- a/src/models/activity/Activity.model.ts +++ b/src/models/activity/Activity.model.ts @@ -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{ +export class Activity extends APBase{ constructor(fields: ActivityFields) { super({ type: ASModelType.Activity, diff --git a/src/models/activity/Activity.types.ts b/src/models/activity/Activity.types.ts index f6c5b8a..08c906e 100644 --- a/src/models/activity/Activity.types.ts +++ b/src/models/activity/Activity.types.ts @@ -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. diff --git a/src/models/actor/Actor.model.ts b/src/models/actor/Actor.model.ts new file mode 100644 index 0000000..afbc0ee --- /dev/null +++ b/src/models/actor/Actor.model.ts @@ -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{ + constructor(fields: ActorFields) { + super({ + type: ASModelType.Profile, + ...fields + }) + } +} \ No newline at end of file diff --git a/src/models/actor/Actor.types.ts b/src/models/actor/Actor.types.ts new file mode 100644 index 0000000..ac3c35e --- /dev/null +++ b/src/models/actor/Actor.types.ts @@ -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; + +} diff --git a/src/models/asBase/ASBase.model.ts b/src/models/apBase/APBase.model.ts similarity index 94% rename from src/models/asBase/ASBase.model.ts rename to src/models/apBase/APBase.model.ts index 60d6dcb..f381c85 100644 --- a/src/models/asBase/ASBase.model.ts +++ b/src/models/apBase/APBase.model.ts @@ -8,7 +8,7 @@ export interface ModelBaseAPWithContext { '@context'?: Context; } -export class ASBase { +export class APBase { public fields: T & ModelBaseAPWithContext; constructor(fields: T) { @@ -31,7 +31,7 @@ export class ASBase { public plain(): Record { const result = {} as Record; 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; diff --git a/src/models/asEvent/ASEvent.model.ts b/src/models/apEvent/APEvent.model.ts similarity index 57% rename from src/models/asEvent/ASEvent.model.ts rename to src/models/apEvent/APEvent.model.ts index 1480f09..b0d650b 100644 --- a/src/models/asEvent/ASEvent.model.ts +++ b/src/models/apEvent/APEvent.model.ts @@ -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{ - constructor(fields: ASEventFields) { +export class APEvent extends APBase{ + constructor(fields: APEventFields) { super({ type: ASModelType.Event, ...fields diff --git a/src/models/apEvent/APEvent.types.ts b/src/models/apEvent/APEvent.types.ts new file mode 100644 index 0000000..fb1166a --- /dev/null +++ b/src/models/apEvent/APEvent.types.ts @@ -0,0 +1,3 @@ +import {APObjectFields} from "../apObject/APObject.types"; + +export interface APEventFields extends APObjectFields {} diff --git a/src/models/asObject/ASObject.model.ts b/src/models/apObject/APObject.model.ts similarity index 71% rename from src/models/asObject/ASObject.model.ts rename to src/models/apObject/APObject.model.ts index a3e6e31..67d0a44 100644 --- a/src/models/asObject/ASObject.model.ts +++ b/src/models/apObject/APObject.model.ts @@ -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{ - constructor(fields: ASObjectFields) { +export class APObject extends APBase{ + constructor(fields: APObjectFields) { super({ type: ASModelType.Object, ...fields diff --git a/src/models/asObject/ASObject.types.ts b/src/models/apObject/APObject.types.ts similarity index 83% rename from src/models/asObject/ASObject.types.ts rename to src/models/apObject/APObject.types.ts index 6da34e7..5fbdb75 100644 --- a/src/models/asObject/ASObject.types.ts +++ b/src/models/apObject/APObject.types.ts @@ -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; } \ No newline at end of file diff --git a/src/models/application/Application.model.ts b/src/models/application/Application.model.ts index 5e7d208..0cea4ed 100644 --- a/src/models/application/Application.model.ts +++ b/src/models/application/Application.model.ts @@ -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{ +export class Application extends APBase{ constructor(fields: ApplicationFields) { super({ type: ASModelType.Application, diff --git a/src/models/application/Application.types.ts b/src/models/application/Application.types.ts index 90b1e83..eafd60a 100644 --- a/src/models/application/Application.types.ts +++ b/src/models/application/Application.types.ts @@ -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 {} diff --git a/src/models/article/Article.model.ts b/src/models/article/Article.model.ts index 629627d..e373536 100644 --- a/src/models/article/Article.model.ts +++ b/src/models/article/Article.model.ts @@ -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{ +export class Article extends APBase{ constructor(fields: ArticleFields) { super({ type: ASModelType.Article, diff --git a/src/models/article/Article.types.ts b/src/models/article/Article.types.ts index 6faf317..b3ae47f 100644 --- a/src/models/article/Article.types.ts +++ b/src/models/article/Article.types.ts @@ -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 {} diff --git a/src/models/asEvent/ASEvent.types.ts b/src/models/asEvent/ASEvent.types.ts deleted file mode 100644 index 53eea20..0000000 --- a/src/models/asEvent/ASEvent.types.ts +++ /dev/null @@ -1,3 +0,0 @@ -import {ASObjectFields} from "../asObject/ASObject.types"; - -export interface ASEventFields extends ASObjectFields {} diff --git a/src/models/audio/Audio.model.ts b/src/models/audio/Audio.model.ts index ad5e92c..b77ca75 100644 --- a/src/models/audio/Audio.model.ts +++ b/src/models/audio/Audio.model.ts @@ -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{ +export class Audio extends APBase{ constructor(fields: AudioFields) { super({ type: ASModelType.Audio, diff --git a/src/models/collection/Collection.model.ts b/src/models/collection/Collection.model.ts index cc14680..21ee530 100644 --- a/src/models/collection/Collection.model.ts +++ b/src/models/collection/Collection.model.ts @@ -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{ +export class Collection extends APBase{ constructor(fields: CollectionFields) { super({ type: ASModelType.Collection, diff --git a/src/models/collection/Collection.types.ts b/src/models/collection/Collection.types.ts index cec2570..0691fe2 100644 --- a/src/models/collection/Collection.types.ts +++ b/src/models/collection/Collection.types.ts @@ -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 diff --git a/src/models/collectionPage/CollectionPage.model.ts b/src/models/collectionPage/CollectionPage.model.ts index 46a89a3..b5e917e 100644 --- a/src/models/collectionPage/CollectionPage.model.ts +++ b/src/models/collectionPage/CollectionPage.model.ts @@ -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{ +export class CollectionPage extends APBase{ constructor(fields: CollectionPageFields) { super({ type: ASModelType.CollectionPage, diff --git a/src/models/document/Document.model.ts b/src/models/document/Document.model.ts index cfdd6b5..5edf538 100644 --- a/src/models/document/Document.model.ts +++ b/src/models/document/Document.model.ts @@ -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{ +export class Document extends APBase{ constructor(fields: DocumentFields) { super({ type: ASModelType.Document, diff --git a/src/models/document/Document.types.ts b/src/models/document/Document.types.ts index 2583559..c055f9a 100644 --- a/src/models/document/Document.types.ts +++ b/src/models/document/Document.types.ts @@ -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 {} diff --git a/src/models/group/Group.model.ts b/src/models/group/Group.model.ts index 7269e4c..ff99c5b 100644 --- a/src/models/group/Group.model.ts +++ b/src/models/group/Group.model.ts @@ -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{ +export class Group extends APBase{ constructor(fields: GroupFields) { super({ type: ASModelType.Group, diff --git a/src/models/group/Group.types.ts b/src/models/group/Group.types.ts index 8a600d9..183d596 100644 --- a/src/models/group/Group.types.ts +++ b/src/models/group/Group.types.ts @@ -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 {} diff --git a/src/models/image/Image.model.ts b/src/models/image/Image.model.ts index c740e48..58234ab 100644 --- a/src/models/image/Image.model.ts +++ b/src/models/image/Image.model.ts @@ -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{ +export class Image extends APBase{ constructor(fields: ImageFields) { super({ type: ASModelType.Image, diff --git a/src/models/intransitiveActivity/IntransitiveActivity.model.ts b/src/models/intransitiveActivity/IntransitiveActivity.model.ts index 98ee428..2bc7821 100644 --- a/src/models/intransitiveActivity/IntransitiveActivity.model.ts +++ b/src/models/intransitiveActivity/IntransitiveActivity.model.ts @@ -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{ +export class IntransitiveActivity extends APBase{ constructor(fields: IntransitiveActivityFields) { super({ type: ASModelType.Activity, diff --git a/src/models/link/Link.model.ts b/src/models/link/Link.model.ts index 28c538e..b488cfa 100644 --- a/src/models/link/Link.model.ts +++ b/src/models/link/Link.model.ts @@ -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{ +export class Link extends APBase{ constructor(fields: LinkFields) { super({ type: ASModelType.Link, diff --git a/src/models/mention/Mention.model.ts b/src/models/mention/Mention.model.ts index a46f7b6..1a09a33 100644 --- a/src/models/mention/Mention.model.ts +++ b/src/models/mention/Mention.model.ts @@ -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{ +export class Mention extends APBase{ constructor(fields: MentionFields) { super({ type: ASModelType.Mention, diff --git a/src/models/note/Note.model.ts b/src/models/note/Note.model.ts index b25ba62..8174329 100644 --- a/src/models/note/Note.model.ts +++ b/src/models/note/Note.model.ts @@ -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{ +export class Note extends APBase{ constructor(fields: NoteFields) { super({ type: ASModelType.Note, diff --git a/src/models/note/Note.types.ts b/src/models/note/Note.types.ts index 07d2d7b..fd3ddd0 100644 --- a/src/models/note/Note.types.ts +++ b/src/models/note/Note.types.ts @@ -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 {} diff --git a/src/models/orderedCollection/OrderedCollection.model.ts b/src/models/orderedCollection/OrderedCollection.model.ts index 00e314f..bf28b72 100644 --- a/src/models/orderedCollection/OrderedCollection.model.ts +++ b/src/models/orderedCollection/OrderedCollection.model.ts @@ -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{ +export class OrderedCollection extends APBase{ constructor(fields: OrderedCollectionFields) { super({ type: ASModelType.OrderedCollection, diff --git a/src/models/orderedCollectionPage/OrderedCollectionPage.model.ts b/src/models/orderedCollectionPage/OrderedCollectionPage.model.ts index b53cb95..5b2e92c 100644 --- a/src/models/orderedCollectionPage/OrderedCollectionPage.model.ts +++ b/src/models/orderedCollectionPage/OrderedCollectionPage.model.ts @@ -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{ +export class OrderedCollectionPage extends APBase{ constructor(fields: OrderedCollectionPageFields) { super({ type: ASModelType.OrderedCollectionPage, diff --git a/src/models/organization/Organization.model.ts b/src/models/organization/Organization.model.ts index 5d00ecc..f02315d 100644 --- a/src/models/organization/Organization.model.ts +++ b/src/models/organization/Organization.model.ts @@ -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{ +export class Organization extends APBase{ constructor(fields: OrganizationFields) { super({ type: ASModelType.Organization, diff --git a/src/models/organization/Organization.types.ts b/src/models/organization/Organization.types.ts index 7889bd1..7637e33 100644 --- a/src/models/organization/Organization.types.ts +++ b/src/models/organization/Organization.types.ts @@ -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 {} diff --git a/src/models/page/Page.model.ts b/src/models/page/Page.model.ts index b322268..34350a8 100644 --- a/src/models/page/Page.model.ts +++ b/src/models/page/Page.model.ts @@ -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{ +export class Page extends APBase{ constructor(fields: PageFields) { super({ type: ASModelType.Page, diff --git a/src/models/person/Person.model.ts b/src/models/person/Person.model.ts index 6671943..c47aa53 100644 --- a/src/models/person/Person.model.ts +++ b/src/models/person/Person.model.ts @@ -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{ +export class Person extends APBase{ constructor(fields: PersonFields) { super({ type: ASModelType.Person, diff --git a/src/models/person/Person.types.ts b/src/models/person/Person.types.ts index df3a79f..7e33503 100644 --- a/src/models/person/Person.types.ts +++ b/src/models/person/Person.types.ts @@ -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 {} diff --git a/src/models/place/Place.model.ts b/src/models/place/Place.model.ts index b5420c6..f874463 100644 --- a/src/models/place/Place.model.ts +++ b/src/models/place/Place.model.ts @@ -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{ +export class Place extends APBase{ constructor(fields: PlaceFields) { super({ type: ASModelType.Place, diff --git a/src/models/place/Place.types.ts b/src/models/place/Place.types.ts index cb6c65e..9223392 100644 --- a/src/models/place/Place.types.ts +++ b/src/models/place/Place.types.ts @@ -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. diff --git a/src/models/profile/Profile.model.ts b/src/models/profile/Profile.model.ts index 9dbd4f9..c995b46 100644 --- a/src/models/profile/Profile.model.ts +++ b/src/models/profile/Profile.model.ts @@ -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{ +export class Profile extends APBase{ constructor(fields: ProfileFields) { super({ type: ASModelType.Profile, diff --git a/src/models/profile/Profile.types.ts b/src/models/profile/Profile.types.ts index 95df778..3199bdc 100644 --- a/src/models/profile/Profile.types.ts +++ b/src/models/profile/Profile.types.ts @@ -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 diff --git a/src/models/question/Question.model.ts b/src/models/question/Question.model.ts index 289d02a..55016ab 100644 --- a/src/models/question/Question.model.ts +++ b/src/models/question/Question.model.ts @@ -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{ +export class Question extends APBase{ constructor(fields: QuestionFields) { super({ type: ASModelType.Question, diff --git a/src/models/relationship/Relationship.model.ts b/src/models/relationship/Relationship.model.ts index b492330..e9b1540 100644 --- a/src/models/relationship/Relationship.model.ts +++ b/src/models/relationship/Relationship.model.ts @@ -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{ +export class Relationship extends APBase{ constructor(fields: RelationshipFields) { super({ type: ASModelType.Relationship, diff --git a/src/models/relationship/Relationship.types.ts b/src/models/relationship/Relationship.types.ts index 64d697a..0cbac3c 100644 --- a/src/models/relationship/Relationship.types.ts +++ b/src/models/relationship/Relationship.types.ts @@ -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. diff --git a/src/models/service/Service.model.ts b/src/models/service/Service.model.ts index b653bdf..484dfa5 100644 --- a/src/models/service/Service.model.ts +++ b/src/models/service/Service.model.ts @@ -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{ +export class Service extends APBase{ constructor(fields: ServiceFields) { super({ type: ASModelType.Service, diff --git a/src/models/service/Service.types.ts b/src/models/service/Service.types.ts index a6d136f..8eb88b2 100644 --- a/src/models/service/Service.types.ts +++ b/src/models/service/Service.types.ts @@ -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 {} diff --git a/src/models/tombstone/Tombstone.model.ts b/src/models/tombstone/Tombstone.model.ts index bd05025..347a2a4 100644 --- a/src/models/tombstone/Tombstone.model.ts +++ b/src/models/tombstone/Tombstone.model.ts @@ -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{ +export class Tombstone extends APBase{ constructor(fields: TombstoneFields) { super({ type: ASModelType.Tombstone, diff --git a/src/models/tombstone/Tombstone.types.ts b/src/models/tombstone/Tombstone.types.ts index 85cf959..5831276 100644 --- a/src/models/tombstone/Tombstone.types.ts +++ b/src/models/tombstone/Tombstone.types.ts @@ -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 diff --git a/src/models/video/Video.model.ts b/src/models/video/Video.model.ts index ee61b45..f8080d8 100644 --- a/src/models/video/Video.model.ts +++ b/src/models/video/Video.model.ts @@ -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{ +export class Video extends APBase{ constructor(fields: VideoFields) { super({ type: ASModelType.Video,