mostly comments2

This commit is contained in:
Michael Puckett 2023-08-01 00:06:15 -04:00
parent 7e79341d06
commit e895dec8cc
12 changed files with 119 additions and 124 deletions

View File

@ -18,8 +18,8 @@ export type CoreObjectProperties = {
duration?: string;
endTime?: Date;
generator?: OrArray<EntityReference>;
icon?: ImageReference | LinkReference | Array<ImageReference | LinkReference>;
image?: ImageReference | LinkReference | Array<ImageReference | LinkReference>;
icon?: OrArray<ImageReference | LinkReference>;
image?: OrArray<ImageReference | LinkReference>;
inReplyTo?: OrArray<EntityReference>;
location?: OrArray<EntityReference>;
mediaType?: string;

View File

@ -15,8 +15,7 @@ export type LinkProperties = {
width?: number;
};
export type BaseLink<T extends AnyLinkType> = BaseEntity<T> & LinkProperties;
type LinkEntity = BaseLink<typeof LinkTypes.LINK>;
export type LinkEntity = BaseLink<typeof LinkTypes.LINK>;
export type Mention = BaseLink<typeof LinkTypes.MENTION>;
export type Link = LinkEntity | Mention;
export type LinkReference = URL | Link;
export {};

View File

@ -2,12 +2,11 @@
import { Link, Mention } from './Link';
import { Actor } from '../Extended/Actor';
import { Activity } from '../Extended/Activity';
import { Collection, OrderedCollection } from '../Extended/Collection';
import { CollectionPage, OrderedCollectionPage } from '../Extended/Collection';
import { AnyCollectionOrCollectionPage } from '../Extended/Collection';
import { ExtendedObject } from '../Extended';
export { CoreObjectProperties } from './CoreObject';
export type { Link, LinkReference, Mention } from './Link';
export type CoreObject = ExtendedObject | Actor | Activity | Collection | OrderedCollection | CollectionPage | OrderedCollectionPage;
export type CoreObject = ExtendedObject | Actor | Activity | AnyCollectionOrCollectionPage;
export type CoreObjectReference = URL | CoreObject;
export type Entity = CoreObject | Link | Mention;
export type EntityReference = URL | Entity;

View File

@ -10,6 +10,7 @@ export type AnyCollectionOrCollectionPageType = AnyCollectionType | AnyCollectio
type CollectionProperties = {
totalItems?: number;
items?: OrArray<EntityReference>;
startIndex?: number;
orderedItems?: OrArray<EntityReference>;
current?: URL | CollectionPage | Link;
first?: URL | CollectionPage | Link;
@ -25,11 +26,7 @@ type CollectionPageProperties = {
};
type BaseCollectionPage<T extends AnyCollectionPageType> = BaseCollection<T> & CollectionPageProperties;
export type CollectionPage = BaseCollectionPage<typeof CollectionPageTypes.COLLECTION_PAGE>;
type OrderedCollectionPageProperties = {
startIndex?: number;
orderedItems?: OrArray<EntityReference>;
};
export type OrderedCollectionPage = BaseCollectionPage<typeof CollectionPageTypes.ORDERED_COLLECTION_PAGE> & OrderedCollectionPageProperties;
export type OrderedCollectionPage = BaseCollectionPage<typeof CollectionPageTypes.ORDERED_COLLECTION_PAGE>;
export type CollectionReference = URL | Collection;
export type OrderedCollectionReference = URL | OrderedCollection;
export type CollectionPageReference = URL | CollectionPage;
@ -38,4 +35,6 @@ export type EitherCollection = Collection | OrderedCollection;
export type EitherCollectionPage = CollectionPage | OrderedCollectionPage;
export type EitherCollectionReference = URL | EitherCollection;
export type EitherCollectionPageReference = URL | EitherCollectionPage;
export type AnyCollectionOrCollectionPage = EitherCollection | EitherCollectionPage;
export type AnyCollectionOrCollectionPageReference = URL | AnyCollectionOrCollectionPage;
export {};

View File

@ -1 +1 @@
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../src/util/const.ts"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAAG;IACjC,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,cAAc;IAC5B,SAAS,EAAE,WAAW;IACtB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;CACV,CAAC;AAEE,QAAA,SAAS,GAAG;IACvB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;CACV,CAAC;AAEE,QAAA,UAAU,GAAG;IACxB,WAAW,EAAE,aAA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,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,gBAAgB,EAAE,iBAAiB;IACnC,gBAAgB,EAAE,iBAAiB;IACnC,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;CACJ,CAAC;AASE,QAAA,yBAAyB,GAAG;IACvC,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;CACZ,CAAC;AASE,QAAA,aAAa,GAAG;IAC3B,GAAG,+BAAuB;IAC1B,GAAG,iCAAyB;CACpB,CAAC;AASE,QAAA,eAAe,GAAG;IAC7B,UAAU,EAAE,YAAY;IACxB,kBAAkB,EAAE,mBAAmB;CAC/B,CAAC;AASE,QAAA,mBAAmB,GAAG;IACjC,eAAe,EAAE,gBAAgB;IACjC,uBAAuB,EAAE,uBAAuB;CACxC,CAAC;AASE,QAAA,eAAe,GAAG;IAC7B,GAAG,2BAAmB;IACtB,GAAG,kBAAU;IACb,GAAG,qBAAa;IAChB,GAAG,uBAAe;IAClB,GAAG,2BAAmB;CACd,CAAC;AAeE,QAAA,QAAQ,GAAG;IACtB,GAAG,uBAAe;IAClB,GAAG,iBAAS;CACJ,CAAC"}

View File

@ -1,12 +1,10 @@
import { TypeOrArrayWithType, AnyType, OrArray } from '../util';
/**
* A base ActivityStreams entity is a plain object that has at least a `type`.
* A base ActivityStreams Entity is a plain object that has at least a `type`
* property.
*
* @note Technically all properties are optional, but this library requires a
* `type` as a way to differentiate between different types of Entities.
*
* @todo Add better support for `@context`.
* @todo Add better support for the `@context` property.
*/
export type BaseEntity<T extends AnyType> = {
'@context'?: OrArray<URL | Record<string, URL>>;

View File

@ -7,26 +7,6 @@ import { EntityReference } from '.';
*/
export type AnyLinkType = (typeof LinkTypes)[keyof typeof LinkTypes];
/**
* Per the ActivityStreams Vocabulary spec:
*
* > 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.
*
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-link
*
* @extends BaseEntity
*
* @instance Link
* @instance Mention
*
*/
/**
* Properties common to all Link types.
*/
@ -43,10 +23,13 @@ export type LinkProperties = {
};
/**
* The base type for all Link entities.
* The base type for all Link types.
*
* @note This differs from Link, which is the type for a Link entity
* specifically. This is the base type for all Link types, including the Link
* and Mention types.
*
* @extends BaseEntity
* @extends LinkProperties
*
* @instance Link
* @instance Mention
@ -56,9 +39,15 @@ export type BaseLink<T extends AnyLinkType> = BaseEntity<T> & LinkProperties;
/**
* A Link entity.
*
* @note This differs from BaseLink, from which it extends. BaseLink is the
* base type for all Link entities. This is the type for the Link entity
* specifically.
* Per the ActivityStreams Vocabulary spec:
*
* > 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.
*
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-link
*/
@ -66,6 +55,14 @@ export type LinkEntity = BaseLink<typeof LinkTypes.LINK>;
/**
* A Mention entity.
*
* Per the ActivityPub spec:
*
* > A Mention is a specialization of Link that represents an @mention.
*
* @extends Link
*
* @see https://www.w3.org/TR/activitypub/#mention
*/
export type Mention = BaseLink<typeof LinkTypes.MENTION>;

View File

@ -1,53 +1,35 @@
import { Link, Mention } from './Link';
import { Actor } from '../Extended/Actor';
import { Activity } from '../Extended/Activity';
import { Collection, OrderedCollection } from '../Extended/Collection';
import { CollectionPage, OrderedCollectionPage } from '../Extended/Collection';
import { AnyCollectionOrCollectionPage } from '../Extended/Collection';
import { ExtendedObject } from '../Extended';
export { CoreObjectProperties } from './CoreObject';
export type { Link, LinkReference, Mention } from './Link';
/**
* Per the spec:
* The base type for all ActivityPub Objects (including Extended Objects).
*
* > The Object is the primary base type for the Activity Streams vocabulary.
*
* > In addition to having a global identifier (expressed as an absolute IRI
* > using the id property) and an "object type" (expressed using the type
* > property), all instances of the Object type share a common set of
* > properties normatively defined by the Activity Vocabulary.
*
* > All properties are optional (including the id ~and the type~).
*
* @note The spec allows the type to be optional, but it is required by this
* library.
* @note This type is named `CoreObject` instead of `Object` because of the
* following concerns:
* - All ActivityPub Objects are objects, but not all objects are
* ActivityPub Objects. In particular, Links are not ActivityPub Objects.
* - There are a set of Extended Objects that inherit from this type.
* - `Object` is a reserved keyword in JavaScript.
*
* @see https://www.w3.org/TR/activitystreams-core/#object
*
* @note All ActivityPub Objects are objects, but not all objects are
* ActivityPub Objects. For example, a Link is an object, but not an
* ActivityPub Object. For this reason, it is referred to as a "Core Object".
*
* @extends BaseEntity
* @extends CoreObjectProperties
*
* @instance ExtendedObject
* @instance Actor
* @instance Activity
* @instance Collection
* @instance OrderedCollection
* @instance CollectionPage
* @instance OrderedCollectionPage
*
*/
export type CoreObject =
| ExtendedObject
| Actor
| Activity
| Collection
| OrderedCollection
| CollectionPage
| OrderedCollectionPage;
| AnyCollectionOrCollectionPage;
/**
* Either a CoreObject or a URL reference to a CoreObject.
@ -55,15 +37,13 @@ export type CoreObject =
export type CoreObjectReference = URL | CoreObject;
/**
* The base type for all ActivityPub entities.
* The base type for all ActivityPub Entities, including Object and Link types.
*
* The ActivityPub spec does not specify a base type, but this library does
* for convenience.
* @note The spec does not specify a base type, but this library does for
* convenience and easier type checking.
*
* @note The spec allows the type to be optional, but it is required by this
* library.
*
* @extends BaseEntity
* library in order to differentiate between different types of Entities.
*
* @instance CoreObject
* @instance Link

View File

@ -39,6 +39,8 @@ export type ActivityProperties = {
/**
* The base type for all Activity entities.
*
* @extends CoreObject
*/
type BaseActivity<T extends AnyActivityType> = BaseEntity<T> &
CoreObjectProperties &
@ -52,7 +54,8 @@ type TransitiveActivityProperties = {
};
/**
* The base type for all TransitiveActivity entities.
* The base type for all TransitiveActivity entities, meaning those that have an
* `object` property.
*
* @note This is not in the spec, but it is useful for type checking.
*
@ -60,20 +63,25 @@ type TransitiveActivityProperties = {
* Vocabulary spec:
*
* > Instances of TransitiveActivity are a subtype of Activity representing
* > transitive actions. The object property is therefore appropriate for
* > for these activities.
* > transitive actions. The object property is therefore required for these
* > activities.
*
* @extends Activity
*/
export type TransitiveActivity<T extends AnyTransitiveActivityType> =
BaseActivity<T> & TransitiveActivityProperties;
/**
* The base type for all IntransitiveActivity entities.
* The base type for all IntransitiveActivity entities, meaning those that do
* not have an `object` property.
*
* Per the ActivityStreams Vocabulary spec:
*
* > Instances of IntransitiveActivity are a subtype of Activity representing
* > intransitive actions. The object property is therefore inappropriate for
* > these activities.
*
* @extends Activity
*/
export type IntransitiveActivity<T extends AnyIntransitiveActivityType> =
BaseActivity<T>;
@ -459,9 +467,7 @@ export type Question = IntransitiveActivity<typeof ActivityTypes.QUESTION> & {
*
* @see https://www.w3.org/TR/activitystreams-core/#activities
*
* @type BaseEntity
* @type CoreObjectProperties
* @type ActivityProperties
* @extends CoreObject
*
* @instance Accept
* @instance TentativeAccept

View File

@ -16,13 +16,13 @@ export type AnyActorType = (typeof ActorTypes)[keyof typeof ActorTypes];
/**
* Properties common to all Actor types.
*
* @note All properties come from the ActivityPub spec.
*
* @see https://www.w3.org/TR/activitystreams-vocabulary/#actors
* @see https://www.w3.org/TR/activitypub/#actors
*
* @note The `manuallyApprovesFollowers` property is not included in the spec,
* but it is included because it is common to all ActivityPub objects in
* practice by way of an extension to the spec.
*/
export type ActorProperties = {
// Activity Pub properties.
inbox: OrderedCollectionReference;
outbox: OrderedCollectionReference;
following?: CollectionReference;
@ -52,8 +52,6 @@ export type ActorProperties = {
* The base type for all Actor entities.
*
* @extends BaseEntity
* @extends CoreObjectProperties
* @extends ActorProperties
*
* @instance Application
* @instance Group
@ -70,7 +68,7 @@ type BaseActor<T extends AnyActorType> = BaseEntity<T> &
*
* > Describes a software application.
*
* @extends BaseActor
* @type Actor
*/
export type Application = BaseActor<typeof ActorTypes.APPLICATION>;
@ -79,7 +77,7 @@ export type Application = BaseActor<typeof ActorTypes.APPLICATION>;
*
* > Represents an individual person.
*
* @extends BaseActor
* @type Actor
*/
export type Person = BaseActor<typeof ActorTypes.PERSON>;
@ -88,7 +86,7 @@ export type Person = BaseActor<typeof ActorTypes.PERSON>;
*
* > Represents a formal or informal collective of Actors.
*
* @extends BaseActor
* @type Actor
*/
export type Group = BaseActor<typeof ActorTypes.GROUP>;
@ -97,7 +95,7 @@ export type Group = BaseActor<typeof ActorTypes.GROUP>;
*
* > Represents a service of any kind.
*
* @extends BaseActor
* @type Actor
*/
export type Service = BaseActor<typeof ActorTypes.SERVICE>;
@ -106,7 +104,7 @@ export type Service = BaseActor<typeof ActorTypes.SERVICE>;
*
* > Represents an organization.
*
* @extends BaseActor
* @type Actor
*/
export type Organization = BaseActor<typeof ActorTypes.ORGANIZATION>;
@ -117,9 +115,7 @@ export type Organization = BaseActor<typeof ActorTypes.ORGANIZATION>;
*
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-actor
*
* @extends BaseEntity
* @extends BaseExtendedObject
* @extends BaseActor
* @extends CoreObject
*
* @instance Application
* @instance Group

View File

@ -67,7 +67,7 @@ export type BaseCollection<T extends AnyCollectionOrCollectionPageType> =
*
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-collection
*
* @extends BaseCollection
* @type Collection
*/
export type Collection = BaseCollection<typeof CollectionTypes.COLLECTION>;
@ -79,7 +79,7 @@ export type Collection = BaseCollection<typeof CollectionTypes.COLLECTION>;
*
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-orderedcollection
*
* @extends BaseCollection
* @extends Collection
*/
export type OrderedCollection = BaseCollection<
typeof CollectionTypes.ORDERED_COLLECTION
@ -97,8 +97,7 @@ type CollectionPageProperties = {
/**
* The base type for all CollectionPage entities.
*
* @extends BaseCollection
* @extends CollectionPageProperties
* @extends Collection
*
* @instance CollectionPage
* @instance OrderedCollectionPage
@ -123,12 +122,7 @@ type BaseCollectionPage<T extends AnyCollectionPageType> = BaseCollection<T> &
* > property of the Activity MAY be used to represent a subset of those
* > likes from a single page.
*
* > A CollectionPage that has a `prev` property with a CollectionPage
* > value describes a time ordered subset of items from a Collection. The
* > items in the subset are ordered by their `published` property such
* > that earliest items have the lowest `published` timestamps.
*
* @extends BaseCollectionPage
* @extends Collection
*
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-collectionpage
* @see https://www.w3.org/TR/activitystreams-core/#collectionpage
@ -149,7 +143,7 @@ export type CollectionPage = BaseCollectionPage<
* This is typically used to represent pages of items in a collection that
* maintain a specific order.
*
* @extends BaseCollectionPage
* @extends CollectionPage
*
* @see CollectionPage
*
@ -206,3 +200,23 @@ export type EitherCollectionReference = URL | EitherCollection;
* reference to a CollectionPage or OrderedCollectionPage object.
*/
export type EitherCollectionPageReference = URL | EitherCollectionPage;
/**
* Any among a Collection, OrderedCollection, CollectionPage, or
* OrderedCollectionPage object.
*
* @note This is useful for functions that accept any type that descends
* from BaseCollection.
*/
export type AnyCollectionOrCollectionPage =
| EitherCollection
| EitherCollectionPage;
/**
* Any among a Collection, OrderedCollection, CollectionPage, or
* OrderedCollectionPage object or a URL reference to a Collection,
* OrderedCollection, CollectionPage, or OrderedCollectionPage object.
*/
export type AnyCollectionOrCollectionPageReference =
| URL
| AnyCollectionOrCollectionPage;

View File

@ -46,7 +46,7 @@ export type BaseExtendedObject<T extends AnyExtendedObjectType> =
* > that has been deleted. It can be used in Collections to signify that there
* > used to be an object at this position, but it has been deleted.
*
* @extends BaseExtendedObject
* @type ExtendedObject
*
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-tombstone
*/
@ -64,7 +64,7 @@ export type Tombstone = BaseExtendedObject<
* > two individuals. The subject and object properties are used to identify the
* > connected individuals.
*
* @extends BaseExtendedObject
* @type ExtendedObject
*
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-relationship
*/
@ -83,7 +83,7 @@ export type Relationship = BaseExtendedObject<
* > to describe Actor Type objects. The describes property is used to reference
* > the object being described by the profile.
*
* @extends BaseExtendedObject
* @type ExtendedObject
*
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-profile
*/
@ -95,7 +95,7 @@ export type Article = BaseExtendedObject<typeof ExtendedObjectTypes.ARTICLE>;
* > Represents a short written work typically less than a single paragraph in
* > length.
*
* @extends BaseExtendedObject
* @type ExtendedObject
*
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-note
*/
@ -106,7 +106,7 @@ export type Note = BaseExtendedObject<typeof ExtendedObjectTypes.NOTE>;
*
* > Represents a Web Page.
*
* @extends BaseExtendedObject
* @type ExtendedObject
*
* @note Technically this extends Document, but Document has no special
* properties.
@ -120,7 +120,7 @@ export type Page = BaseExtendedObject<typeof ExtendedObjectTypes.PAGE>;
*
* > Represents any kind of event.
*
* @extends BaseExtendedObject
* @type ExtendedObject
*
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-event
*/
@ -142,7 +142,7 @@ export type Event = BaseExtendedObject<typeof ExtendedObjectTypes.EVENT>;
* > describing locations consistently across Activity Streams 2.0
* > implementations.
*
* @extends BaseExtendedObject
* @type ExtendedObject
*
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-place
* @see https://www.w3.org/TR/activitystreams-vocabulary/#places
@ -163,7 +163,7 @@ export type Place = BaseExtendedObject<typeof ExtendedObjectTypes.PLACE> & {
* > used to describe things that are capable of being embedded or attached to
* > other content.
*
* @extends BaseExtendedObject
* @type ExtendedObject
*
* @note Technically several other types extend Document, but Document has no
* special properties. The types include: Image, Audio, Video, and Profile.
@ -177,7 +177,7 @@ export type Document = BaseExtendedObject<typeof ExtendedObjectTypes.DOCUMENT>;
*
* > An image document of any kind.
*
* @extends BaseExtendedObject
* @type ExtendedObject
*
* @note Technically this extends Document, but Document has no special
* properties.
@ -191,7 +191,7 @@ export type Image = BaseExtendedObject<typeof ExtendedObjectTypes.IMAGE>;
*
* > Represents an audio document of any kind.
*
* @extends BaseExtendedObject
* @type ExtendedObject
*
* @note Technically this extends Document, but Document has no special
* properties.
@ -205,7 +205,7 @@ export type Audio = BaseExtendedObject<typeof ExtendedObjectTypes.AUDIO>;
*
* > Represents a video document of any kind.
*
* @extends BaseExtendedObject
* @type ExtendedObject
*
* @note Technically this extends Document, but Document has no special
* properties.
@ -221,7 +221,7 @@ export type Video = BaseExtendedObject<typeof ExtendedObjectTypes.VIDEO>;
* > to describe Actor Type objects. The describes property is used to reference
* > the object being described by the profile.
*
* @extends BaseExtendedObject
* @type ExtendedObject
*
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-profile
*/
@ -230,9 +230,9 @@ export type Profile = BaseExtendedObject<typeof ExtendedObjectTypes.PROFILE> & {
};
/**
* A hashtag.
* A Hashtag.
*
* @extends BaseExtendedObject
* @type ExtendedObject
*
* @note This is not part of the ActivityPub spec, but it is common in practice
* by way of extensions to the spec.
@ -244,8 +244,7 @@ export type Hashtag = BaseExtendedObject<typeof ExtendedObjectTypes.HASHTAG>;
/**
* A union of all Extended Object types.
*
* @extends BaseEntity
* @extends BaseExtendedObject
* @extends CoreObject
*
* @see https://www.w3.org/TR/activitystreams-vocabulary/#extendedtypes
*/
@ -263,5 +262,13 @@ export type ExtendedObject =
| Audio
| Image
| Hashtag;
/**
* An Extended Object or a URL reference to an Extended Object.
*/
export type ExtendedObjectReference = URL | ExtendedObject;
/**
* An Image or a URL reference to an Image.
*/
export type ImageReference = URL | Image;