Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

activitypub-types

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

activitypub-types - npm Package Compare versions

Comparing version 1.0.3 to 1.1.0

dist/model-interfaces/documents/article.interface.d.ts

192

dist/fields/index.d.ts
import { APCollection, APOrderedCollection, APObject, APArticle, APAudio, APDocument, APEvent, APImage, APNote, APPage, APPlace, APProfile, APRelationship, APTombstone, APVideo, APLink, APCollectionPage, APOrderedCollectionPage, APMention } from '../model-interfaces';
export declare type AnyCollection = APCollection | APOrderedCollection;
export declare type AnyAPObject = APObject | APArticle | APAudio | APDocument | APEvent | APImage | APNote | APPage | APPlace | APProfile | APRelationship | APTombstone | APVideo | AnyCollection;
export declare type DateTime = string | Date;
export declare type LanguageTag = string;
export declare type MediaType = string;
export declare type Duration = string;
export declare type ContextField = string | Record<string, string>;
export declare type UrlField = string | APLink;
export declare type IdField = string;
export declare type TypeField = string;
export declare type DurationField = Duration;
export declare type ContentField = string;
export declare type ContentMapField = Record<string, string>;
export declare type MediaTypeField = MediaType;
export declare type NameField = string;
export declare type NameMapField = Record<string, string>;
export declare type SummaryField = string;
export declare type SummaryMapField = Record<string, string>;
export declare type EndTimeField = DateTime;
export declare type StartTimeField = DateTime;
export declare type PublishedField = DateTime;
export declare type UpdatedField = DateTime;
export declare type RepliesField = string | AnyCollection;
export declare type RelationshipField = string | AnyAPObject;
export declare type IconField = string | APImage | APLink;
export declare type ImageField = string | APImage | APLink;
export declare type AttachmentField = string | AnyAPObject | APLink;
export declare type AudienceField = string | AnyAPObject | APLink;
export declare type InReplyToField = string | AnyAPObject | APLink;
export declare type LocationField = string | APPlace | APLink;
export declare type PreviewField = string | AnyAPObject | APLink;
export declare type ToField = string | AnyAPObject | APLink;
export declare type BtoField = string | AnyAPObject | APLink;
export declare type CcField = string | AnyAPObject | APLink;
export declare type BccField = string | AnyAPObject | APLink;
export declare type GeneratorField = string | AnyAPObject | APLink;
export declare type ObjectField = string | AnyAPObject | APLink;
export declare type AttributedToField = string | AnyAPObject | APLink | APMention;
export declare type TagField = string | AnyAPObject | APLink | APMention;
export declare type ActorField = string | AnyAPObject | APLink;
export declare type TargetField = string | AnyAPObject | APLink;
export declare type ResultField = string | AnyAPObject | APLink;
export declare type OriginField = string | AnyAPObject | APLink;
export declare type InstrumentField = string | AnyAPObject | APLink;
export declare type OneOfField = string | AnyAPObject | APLink;
export declare type AnyOfField = string | AnyAPObject | APLink;
export declare type SubjectField = string | AnyAPObject | APLink;
export declare type AccuracyField = number;
export declare type AltitudeField = number;
export declare type LatitudeField = number;
export declare type LongitudeField = number;
export declare type RadiusField = number;
export declare type UnitsField = 'cm' | 'feet' | 'inches' | 'km' | 'm' | 'miles' | string;
export declare type ClosedField = string | AnyAPObject | APLink | DateTime | boolean;
export declare type FormerTypeField = string;
export declare type DeletedField = DateTime;
export declare type DescribesField = string | AnyAPObject;
export declare type HrefField = string;
export declare type HreflangField = LanguageTag;
export declare type RelField = string;
export declare type HeightField = number;
export declare type WidthField = number;
export declare type TotalItemsField = number;
export declare type CollectionCurrentField = string | APCollectionPage | APLink;
export declare type CollectionFirstField = string | APCollectionPage | APLink;
export declare type CollectionLastField = string | APCollectionPage | APLink;
export declare type CollectionItemsField = string | APCollectionPage | APLink;
export declare type CollectionPagePartOfField = string | APCollection | APLink;
export declare type CollectionPageNextField = string | APCollection | APLink;
export declare type CollectionPagePrevField = string | APCollection | APLink;
export declare type OrderedCollectionCurrentField = string | APOrderedCollectionPage | APLink;
export declare type OrderedCollectionFirstField = string | APOrderedCollectionPage | APLink;
export declare type OrderedCollectionLastField = string | APOrderedCollectionPage | APLink;
export declare type OrderedCollectionItemsField = string | APOrderedCollectionPage | APLink;
export declare type OrderedCollectionPagePartOfField = string | APOrderedCollection | APLink;
export declare type OrderedCollectionPageNextField = string | APOrderedCollection | APLink;
export declare type OrderedCollectionPagePrevField = string | APOrderedCollection | APLink;
export declare type StartIndexField = number;
export declare type SourceField = {
export type AnyCollection = APCollection | APOrderedCollection;
export type AnyAPObject = APObject | APArticle | APAudio | APDocument | APEvent | APImage | APNote | APPage | APPlace | APProfile | APRelationship | APTombstone | APVideo | AnyCollection;
export type DateTime = string | Date;
export type LanguageTag = string;
export type MediaType = string;
export type Duration = string;
export type ContextField = string | Record<string, string>;
export type UrlField = string | APLink;
export type IdField = string;
export type TypeField = string;
export type DurationField = Duration;
export type ContentField = string;
export type ContentMapField = Record<string, string>;
export type MediaTypeField = MediaType;
export type NameField = string;
export type NameMapField = Record<string, string>;
export type SummaryField = string;
export type SummaryMapField = Record<string, string>;
export type EndTimeField = DateTime;
export type StartTimeField = DateTime;
export type PublishedField = DateTime;
export type UpdatedField = DateTime;
export type RepliesField = string | AnyCollection;
export type RelationshipField = string | AnyAPObject;
export type IconField = string | APImage | APLink;
export type ImageField = string | APImage | APLink;
export type AttachmentField = string | AnyAPObject | APLink;
export type AudienceField = string | AnyAPObject | APLink;
export type InReplyToField = string | AnyAPObject | APLink;
export type LocationField = string | APPlace | APLink;
export type PreviewField = string | AnyAPObject | APLink;
export type ToField = string | AnyAPObject | APLink;
export type BtoField = string | AnyAPObject | APLink;
export type CcField = string | AnyAPObject | APLink;
export type BccField = string | AnyAPObject | APLink;
export type GeneratorField = string | AnyAPObject | APLink;
export type ObjectField = string | AnyAPObject | APLink;
export type AttributedToField = string | AnyAPObject | APLink | APMention;
export type TagField = string | AnyAPObject | APLink | APMention;
export type ActorField = string | AnyAPObject | APLink;
export type TargetField = string | AnyAPObject | APLink;
export type ResultField = string | AnyAPObject | APLink;
export type OriginField = string | AnyAPObject | APLink;
export type InstrumentField = string | AnyAPObject | APLink;
export type OneOfField = string | AnyAPObject | APLink;
export type AnyOfField = string | AnyAPObject | APLink;
export type SubjectField = string | AnyAPObject | APLink;
export type AccuracyField = number;
export type AltitudeField = number;
export type LatitudeField = number;
export type LongitudeField = number;
export type RadiusField = number;
export type UnitsField = 'cm' | 'feet' | 'inches' | 'km' | 'm' | 'miles' | string;
export type ClosedField = string | AnyAPObject | APLink | DateTime | boolean;
export type FormerTypeField = string;
export type DeletedField = DateTime;
export type DescribesField = string | AnyAPObject;
export type HrefField = string;
export type HreflangField = LanguageTag;
export type RelField = string;
export type HeightField = number;
export type WidthField = number;
export type TotalItemsField = number;
export type CollectionCurrentField = string | APCollectionPage | APLink;
export type CollectionFirstField = string | APCollectionPage | APLink;
export type CollectionLastField = string | APCollectionPage | APLink;
export type CollectionItemsField = string | APCollectionPage | APLink;
export type CollectionPagePartOfField = string | APCollection | APLink;
export type CollectionPageNextField = string | APCollection | APLink;
export type CollectionPagePrevField = string | APCollection | APLink;
export type OrderedCollectionCurrentField = string | APOrderedCollectionPage | APLink;
export type OrderedCollectionFirstField = string | APOrderedCollectionPage | APLink;
export type OrderedCollectionLastField = string | APOrderedCollectionPage | APLink;
export type OrderedCollectionItemsField = string | APOrderedCollectionPage | APLink;
export type OrderedCollectionPagePartOfField = string | APOrderedCollection | APLink;
export type OrderedCollectionPageNextField = string | APOrderedCollection | APLink;
export type OrderedCollectionPagePrevField = string | APOrderedCollection | APLink;
export type StartIndexField = number;
export type SourceField = {
content: ContentField;
mediaType?: MediaType;
};
export declare type InboxField = string | APOrderedCollection | APLink;
export declare type OutboxField = string | APOrderedCollection | APLink;
export declare type FollowingField = string | APCollection | APOrderedCollection | APLink;
export declare type FollowersField = string | APCollection | APOrderedCollection | APLink;
export declare type LikedField = string | APCollection | APOrderedCollection | APLink;
export declare type LikesField = string | APCollection | APOrderedCollection | APLink;
export declare type SharesField = string | APCollection | APOrderedCollection | APLink;
export declare type StreamsField = string | APCollection | APOrderedCollection | APLink;
export declare type PreferredUsernameField = string;
export declare type PreferredUsernameMapField = Record<string, string>;
export declare type ProxyUrlField = string;
export declare type OauthAuthorizationEndpointField = string;
export declare type OauthTokenEndpointField = string;
export declare type ProvideClientKeyField = string;
export declare type SignClientKeyField = string;
export declare type SharedInboxField = string;
export declare type EndpointsField = {
export type InboxField = string | APOrderedCollection | APLink;
export type OutboxField = string | APOrderedCollection | APLink;
export type FollowingField = string | APCollection | APOrderedCollection | APLink;
export type FollowersField = string | APCollection | APOrderedCollection | APLink;
export type LikedField = string | APCollection | APOrderedCollection | APLink;
export type LikesField = string | APCollection | APOrderedCollection | APLink;
export type SharesField = string | APCollection | APOrderedCollection | APLink;
export type StreamsField = string | APCollection | APOrderedCollection | APLink;
export type PreferredUsernameField = string;
export type PreferredUsernameMapField = Record<string, string>;
export type ProxyUrlField = string;
export type OauthAuthorizationEndpointField = string;
export type OauthTokenEndpointField = string;
export type ProvideClientKeyField = string;
export type SignClientKeyField = string;
export type SharedInboxField = string;
export type EndpointsField = {
proxyUrl?: ProxyUrlField;

@@ -102,0 +102,0 @@ oauthAuthorizationEndpoint?: OauthAuthorizationEndpointField;

export * from './fields';
export * from './model-interfaces';
export * from './utils';
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -15,1 +19,2 @@ if (k2 === undefined) k2 = k;

__exportStar(require("./model-interfaces"), exports);
__exportStar(require("./utils"), exports);
import { APActivity } from './activity.interface';
export declare type APAccept = APActivity;
/**
* Indicates that the `actor` accepts the `object`.
* The `target` property can be used in certain circumstances
* to indicate the context into which the `object` has been accepted.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-accept Docs}
*/
export interface APAccept extends APActivity {
type: 'Accept';
}

@@ -1,3 +0,14 @@

import { APObject } from '../common/object.interface';
import { APObject } from '../objects/object.interface';
import { ActorField, InstrumentField, ObjectField, OriginField, ResultField, TargetField } from '../../fields';
/**
* An `Activity` is a subtype of [Object](../objects/object.interface.ts)
* that describes some form of action that may happen,
* is currently happening, or has already happened.
* The `Activity` type itself serves as an abstract base
* type for all types of activities.
* It is important to note that the `Activity` type itself does not
* carry any specific semantics about the kind of action being taken.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-activity Docs}
*/
export interface APActivity extends APObject {

@@ -4,0 +15,0 @@ /**

import { APActivity } from './activity.interface';
export declare type APAdd = APActivity;
/**
* Indicates that the `actor` has added the `object` to the `target`.
* If the `target` property is not explicitly specified,
* the target would need to be determined implicitly by context.
* The origin can be used to identify the `context` from which the `object` originated.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-add Docs}
*/
export interface APAdd extends APActivity {
type: 'Add';
}
import { APActivity } from './activity.interface';
export declare type APAnnounce = APActivity;
/**
* Indicates that the `actor` is calling the `target`'s attention the `object`.
* The `origin` typically has no defined meaning.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-announce Docs}
*/
export interface APAnnounce extends APActivity {
type: 'Announce';
}
import { APIntransitiveActivity } from './intransitive-activity.interface';
export declare type APArrive = APIntransitiveActivity;
/**
* An [IntransitiveActivity](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-intransitiveactivity)
* that indicates that the actor has arrived at the `location`.
* The `origin` can be used to identify the `context` from which the actor originated.
* The `target` typically has no defined meaning.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-arrive Docs}
*/
export interface APArrive extends APIntransitiveActivity {
type: 'Arrive';
}
import { APIgnore } from './ignore.interface';
export declare type APBlock = APIgnore;
/**
* Indicates that the `actor` is blocking the `object`.
* Blocking is a stronger form of [Ignore](./ignore.interface.ts).
* The typical use is to support social systems that allow
* one user to block activities or content of other users.
* The `target` and `origin` typically have no defined meaning.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-block Docs}
*/
export interface APBlock extends Omit<APIgnore, 'type'> {
type: 'Block';
}
import { APActivity } from './activity.interface';
export declare type APCreate = APActivity;
/**
* Indicates that the `actor` has created the `object`.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-create Docs}
*/
export interface APCreate extends APActivity {
type: 'Create';
}
import { APActivity } from './activity.interface';
export declare type APDelete = APActivity;
/**
* Indicates that the `actor` has deleted the object.
* If specified, the `origin` indicates the context
* from which the object was deleted.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-delete Docs}
*/
export interface APDelete extends APActivity {
type: 'Delete';
}
import { APActivity } from './activity.interface';
export declare type APDislike = APActivity;
/**
* Indicates that the `actor` dislikes the `object`.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-dislike Docs}
*/
export interface APDislike extends APActivity {
type: 'Dislike';
}
import { APActivity } from './activity.interface';
export declare type APFlag = APActivity;
/**
* Indicates that the `actor` is "flagging" the `object`.
* Flagging is defined in the sense common to many social platforms
* as reporting content as being inappropriate for any number of reasons.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-flag Docs}
*/
export interface APFlag extends APActivity {
type: 'Flag';
}
import { APActivity } from './activity.interface';
export declare type APFollow = APActivity;
/**
* Indicates that the `actor` is "following" the `object`.
* Following is defined in the sense typically used within
* Social systems in which the actor is interested in any
* activity performed by or on the object.
* The `target` and `origin` typically have no defined meaning.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-follow Docs}
*/
export interface APFollow extends APActivity {
type: 'Follow';
}
import { APActivity } from './activity.interface';
export declare type APIgnore = APActivity;
/**
* Indicates that the `actor` is ignoring the `object`.
* The `target` and `origin` typically have no defined meaning.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-ignore Docs}
*/
export interface APIgnore extends APActivity {
type: 'Ignore';
}
import { APActivity } from './activity.interface';
export declare type APIntransitiveActivity = Omit<APActivity, 'object'>;
/**
* Instances of `IntransitiveActivity` are a subtype of `Activity` representing intransitive actions.
* The `object` property is therefore inappropriate for these activities.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-intransitiveactivity Docs}
*/
export type APIntransitiveActivity = Omit<APActivity, 'object'>;
import { APOffer } from './offer.interface';
export declare type APInvite = APOffer;
/**
* A specialization of [Offer](./offer.interface.ts)
* in which the `actor` is extending an invitation
* for the `object` to the `target`.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-invite Docs}
*/
export interface APInvite extends Omit<APOffer, 'type'> {
type: 'Invite';
}
import { APActivity } from './activity.interface';
export declare type APJoin = APActivity;
/**
* Indicates that the `actor` has joined the `object`.
* The `target` and `origin` typically have no defined meaning.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-join Docs}
*/
export interface APJoin extends APActivity {
type: 'Join';
}
import { APActivity } from './activity.interface';
export declare type APLeave = APActivity;
/**
* Indicates that the `actor` has left the `object`.
* The `target` and `origin` typically have no meaning.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-leave Docs}
*/
export interface APLeave extends APActivity {
type: 'Leave';
}
import { APActivity } from './activity.interface';
export declare type APLike = APActivity;
/**
* Indicates that the `actor` likes, recommends or endorses the `object`.
* The `target` and `origin` typically have no defined meaning.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-like Docs}
*/
export interface APLike extends APActivity {
type: 'Like';
}
import { APActivity } from './activity.interface';
export declare type APListen = APActivity;
/**
* Indicates that the `actor` has listened to the `object`.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-listen Docs}
*/
export interface APListen extends APActivity {
type: 'Listen';
}
import { APActivity } from './activity.interface';
export declare type APMove = APActivity;
/**
* Indicates that the `actor` has moved `object` from `origin` to `target`.
* If the `origin` or `target` are not specified, either can be determined by context.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-move Docs}
*/
export interface APMove extends APActivity {
type: 'Move';
}
import { APActivity } from './activity.interface';
export declare type APOffer = APActivity;
/**
* Indicates that the `actor` is offering the `object`.
* If specified, the `target` indicates the entity to
* which the object is being offered.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-offer Docs}
*/
export interface APOffer extends APActivity {
type: 'Offer';
}
import { AnyOfField, ClosedField, OneOfField } from '../../fields';
import { APIntransitiveActivity } from './intransitive-activity.interface';
export interface APQuestion extends APIntransitiveActivity {
interface Question extends APIntransitiveActivity {
type: 'Question';
/**

@@ -27,1 +28,16 @@ * Identifies an exclusive option for a Question.

}
/**
* Represents a question being asked.
* Question objects are an extension of [IntransitiveActivity](./intransitive-activity.interface.ts).
* That is, the `Question` object is an `Activity`,
* but the direct object is the question itself and
* therefore it would not contain an `object` property.
*
* Either of the `anyOf` and `oneOf` properties MAY be
* used to express possible answers, but a `Question`
* object MUST NOT have both properties.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-question Docs}
*/
export type APQuestion = Omit<Question, 'anyOf'> | Omit<Question, 'oneOf'> | Omit<Question, 'anyOf' | 'oneOf'>;
export {};
import { APActivity } from './activity.interface';
export declare type APRead = APActivity;
/**
* Indicates that the `actor` has read the `object`.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-read Docs}
*/
export interface APRead extends APActivity {
type: 'Read';
}
import { APActivity } from './activity.interface';
export declare type APReject = APActivity;
/**
* Indicates that the `actor` is rejecting the `object`.
* The `target` and `origin` typically have no defined meaning.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-reject Docs}
*/
export interface APReject extends APActivity {
type: 'Reject';
}
import { APActivity } from './activity.interface';
export declare type APRemove = APActivity;
/**
* Indicates that the `actor` is removing the `object`.
* If specified, the `origin` indicates the context
* from which the `object` is being removed.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-remove Docs}
*/
export interface APRemove extends APActivity {
type: 'Remove';
}
import { APAccept } from './accept.interface';
export declare type APTentativeAccept = APAccept;
/**
* A specialization of [Accept](./accept.interface.ts)
* indicating that the acceptance is tentative.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-tentativeaccept Docs}
*/
export interface APTentativeAccept extends Omit<APAccept, 'type'> {
type: 'TentativeAccept';
}
import { APReject } from './reject.interface';
export declare type APTentativeReject = APReject;
/**
* A specialization of [Reject](./reject.interface.ts)
* in which the rejection is considered tentative.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-tentativereject Docs}
*/
export interface APTentativeReject extends Omit<APReject, 'type'> {
type: 'TentativeReject';
}
import { APIntransitiveActivity } from './intransitive-activity.interface';
export declare type APTravel = APIntransitiveActivity;
/**
* Indicates that the `actor` is traveling to `target` from `origin`.
* Travel is an `IntransitiveObject` whose `actor` specifies the direct object.
* If the `target` or `origin` are not specified, either can be determined by context.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-travel Docs}
*/
export interface APTravel extends APIntransitiveActivity {
type: 'Travel';
}
import { APActivity } from './activity.interface';
export declare type APUndo = APActivity;
/**
* Indicates that the `actor` is undoing the `object`.
* In most cases, the `object` will be an [Activity](./activity.interface.ts)
* describing some previously performed action (for instance, a person may
* have previously "liked" an article but, for whatever reason, might choose
* to undo that like at some later point in time).
*
* The `target` and `origin` typically have no defined meaning.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-undo Docs}
*/
export interface APUndo extends APActivity {
type: 'Undo';
}
import { APActivity } from './activity.interface';
export declare type APUpdate = APActivity;
/**
* Indicates that the `actor` has updated the `object`.
* Note, however, that this vocabulary does not define a mechanism
* for describing the actual set of modifications made to object.
*
* The `target` and `origin` typically have no defined meaning.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-update Docs}
*/
export interface APUpdate extends APActivity {
type: 'Update';
}
import { APActivity } from './activity.interface';
export declare type APView = APActivity;
/**
* Indicates that the `actor` has viewed the `object`.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-view Docs}
*/
export interface APView extends APActivity {
type: 'View';
}

@@ -1,3 +0,9 @@

import { APObject } from '../common/object.interface';
import { APObject } from '../objects/object.interface';
import { FollowersField, FollowingField, InboxField, LikedField, OutboxField, PreferredUsernameMapField, PreferredUsernameField, StreamsField, EndpointsField } from '../../fields';
/**
* `Actor` types are [Object](../objects/object.interface.ts)
* types that are capable of performing activities.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#actor-types Docs}
*/
export interface APActor extends APObject {

@@ -4,0 +10,0 @@ inbox: InboxField;

import { APActor } from './actor.interface';
export declare type APApplication = APActor;
/**
* Describes a software application.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-application Docs}
*/
export interface APApplication extends APActor {
type: 'Application';
}
import { APActor } from './actor.interface';
export declare type APGroup = APActor;
/**
* Represents a formal or informal collective of Actors.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-group Docs}
*/
export interface APGroup extends APActor {
type: 'Group';
}
import { APActor } from './actor.interface';
export declare type APOrganization = APActor;
/**
* Represents an organization.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-organization Docs}
*/
export interface APOrganization extends APActor {
type: 'Organization';
}
import { APActor } from './actor.interface';
export declare type APPerson = APActor;
/**
* Represents an individual person.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-person Docs}
*/
export interface APPerson extends APActor {
type: 'Person';
}
import { APActor } from './actor.interface';
export declare type APService = APActor;
/**
* Describes a software service.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-service Docs}
*/
export interface APService extends APActor {
type: 'Service';
}
import { APCollection } from './collection.interface';
import { CollectionPageNextField, CollectionPagePartOfField, CollectionPagePrevField } from '../../fields';
export interface APCollectionPage extends APCollection {
/**
* Used to represent distinct subsets of items from a [Collection](./collection.interface.ts).
*
* Refer to the [Activity Streams 2.0 Core](https://www.w3.org/TR/activitystreams-core/#dfn-collectionpage)
* specification for a complete description of the `CollectionPage` object.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-collectionpage Docs}
*/
export interface APCollectionPage extends Omit<APCollection, 'type'> {
type: 'CollectionPage';
/**

@@ -5,0 +14,0 @@ * Identifies the Collection to which a CollectionPage objects items belong.

@@ -1,4 +0,15 @@

import { APObject } from '../common/object.interface';
import { APObject } from '../objects/object.interface';
import { CollectionCurrentField, CollectionFirstField, CollectionItemsField, CollectionLastField, TotalItemsField } from '../../fields';
/**
* A `Collection` is a subtype of [Object](../objects/object.interface.ts) that
* represents ordered or unordered sets of [Object](../objects/object.interface.ts)
* or [Link](../objects/link.interface.ts) instances.
*
* Refer to the [Activity Streams 2.0 Core](https://www.w3.org/TR/activitystreams-core/#collection)
* specification for a complete description of the `Collection` type.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-collection Docs}
*/
export interface APCollection extends APObject {
type: 'Collection';
/**

@@ -5,0 +16,0 @@ * A non-negative integer specifying the total number of objects contained by

@@ -1,23 +0,15 @@

import { OrderedCollectionPageNextField, OrderedCollectionPagePartOfField, OrderedCollectionPagePrevField, StartIndexField } from '../../fields';
import { StartIndexField } from '../../fields';
import { APCollectionPage } from './collection-page.interface';
import { APOrderedCollection } from './ordered-collection.interface';
export interface APOrderedCollectionPage extends APOrderedCollection {
/**
* Used to represent ordered subsets of items from an [OrderedCollection](./ordered-collection.interface.ts).
*
* Refer to the [Activity Streams 2.0 Core](https://www.w3.org/TR/activitystreams-core/#dfn-orderedcollectionpage)
* specification for a complete description of the `OrderedCollectionPage` object.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-orderedcollectionpage Docs}
*/
export interface APOrderedCollectionPage extends Omit<APOrderedCollection, 'type'>, Omit<APCollectionPage, 'type' | 'items'> {
type: 'OrderedCollectionPage';
/**
* Identifies the OrderedCollection to which a OrderedCollectionPage objects items belong.
*
* {@link https://www.w3.org/ns/activitystreams#partOf Docs}
*/
partOf?: OrderedCollectionPagePartOfField;
/**
* In a paged OrderedCollection, indicates the next page of items.
*
* {@link https://www.w3.org/ns/activitystreams#next Docs}
*/
next?: OrderedCollectionPageNextField;
/**
* In a paged OrderedCollection, identifies the previous page of items.
*
* {@link https://www.w3.org/ns/activitystreams#prev Docs}
*/
prev?: OrderedCollectionPagePrevField;
/**
* A non-negative integer value identifying the relative position

@@ -24,0 +16,0 @@ * within the logical view of a strictly ordered collection.

@@ -1,34 +0,12 @@

import { OrderedCollectionCurrentField, OrderedCollectionFirstField, OrderedCollectionItemsField, OrderedCollectionLastField, TotalItemsField } from '../../fields';
import { APObject } from '../common/object.interface';
export interface APOrderedCollection extends APObject {
import { OrderedCollectionItemsField } from '../../fields';
import { APCollection } from './collection.interface';
/**
* A subtype of [Collection](./collection.interface.ts) in which members
* of the logical collection are assumed to always be strictly ordered.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-orderedcollection Docs}
*/
export interface APOrderedCollection extends Omit<APCollection, 'type' | 'items'> {
type: 'OrderedCollection';
/**
* A non-negative integer specifying the total number of objects contained by
* the logical view of the collection. This number might not reflect the actual
* number of items serialized within the Collection object instance.
*
* {@link https://www.w3.org/ns/activitystreams#totalItems Docs}
*/
totalItems?: TotalItemsField;
/**
* In a paged OrderedCollection, indicates the page that contains
* the most recently updated member items.
*
* {@link https://www.w3.org/ns/activitystreams#current Docs}
*/
current?: OrderedCollectionCurrentField;
/**
* In a paged OrderedCollection, indicates the furthest proceeding
* page of items in the collection.
*
* {@link https://www.w3.org/ns/activitystreams#first Docs}
*/
first?: OrderedCollectionFirstField;
/**
* In a paged OrderedCollection, indicates the furthest proceeding
* page of the collection.
*
* {@link https://www.w3.org/ns/activitystreams#last Docs}
*/
last?: OrderedCollectionLastField;
/**
* Identifies the ordered items contained in a collection.

@@ -35,0 +13,0 @@ * The items must be ordered.

import { APDocument } from './document.interface';
export declare type APAudio = APDocument;
/**
* Represents an audio document of any kind.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-audio Docs}
*/
export interface APAudio extends Omit<APDocument, 'type'> {
type: 'Audio';
}

@@ -1,2 +0,9 @@

import { APObject } from '../common/object.interface';
export declare type APDocument = APObject;
import { APObject } from '../objects/object.interface';
/**
* Represents a document of any kind.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-document Docs}
*/
export interface APDocument extends APObject {
type: 'Document';
}
import { APDocument } from './document.interface';
export declare type APImage = APDocument;
/**
* An image document of any kind
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-image Docs}
*/
export interface APImage extends Omit<APDocument, 'type'> {
type: 'Image';
}
import { APDocument } from './document.interface';
export declare type APPage = APDocument;
/**
* Represents a Web Page.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-page Docs}
*/
export interface APPage extends Omit<APDocument, 'type'> {
type: 'Page';
}
import { APDocument } from './document.interface';
export declare type APVideo = APDocument;
/**
* Represents a video document of any kind.
*
* {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-video Docs}
*/
export interface APVideo extends Omit<APDocument, 'type'> {
type: 'Video';
}

@@ -1,11 +0,9 @@

export * from './common/article.interface';
export * from './common/event.interface';
export * from './common/link.interface';
export * from './common/mention.interface';
export * from './common/note.interface';
export * from './common/object.interface';
export * from './common/place.interface';
export * from './common/profile.interface';
export * from './common/tombstone.interface';
export * from './common/relationship.interface';
export * from './objects/event.interface';
export * from './objects/link.interface';
export * from './objects/mention.interface';
export * from './objects/object.interface';
export * from './objects/place.interface';
export * from './objects/profile.interface';
export * from './objects/tombstone.interface';
export * from './objects/relationship.interface';
export * from './activities/activity.interface';

@@ -51,6 +49,8 @@ export * from './activities/intransitive-activity.interface';

export * from './collections/ordered-collection-page.interface';
export * from './documents/article.interface';
export * from './documents/document.interface';
export * from './documents/audio.interface';
export * from './documents/image.interface';
export * from './documents/note.interface';
export * from './documents/page.interface';
export * from './documents/video.interface';
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -13,12 +17,10 @@ if (k2 === undefined) k2 = k;

Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./common/article.interface"), exports);
__exportStar(require("./common/event.interface"), exports);
__exportStar(require("./common/link.interface"), exports);
__exportStar(require("./common/mention.interface"), exports);
__exportStar(require("./common/note.interface"), exports);
__exportStar(require("./common/object.interface"), exports);
__exportStar(require("./common/place.interface"), exports);
__exportStar(require("./common/profile.interface"), exports);
__exportStar(require("./common/tombstone.interface"), exports);
__exportStar(require("./common/relationship.interface"), exports);
__exportStar(require("./objects/event.interface"), exports);
__exportStar(require("./objects/link.interface"), exports);
__exportStar(require("./objects/mention.interface"), exports);
__exportStar(require("./objects/object.interface"), exports);
__exportStar(require("./objects/place.interface"), exports);
__exportStar(require("./objects/profile.interface"), exports);
__exportStar(require("./objects/tombstone.interface"), exports);
__exportStar(require("./objects/relationship.interface"), exports);
__exportStar(require("./activities/activity.interface"), exports);

@@ -64,6 +66,8 @@ __exportStar(require("./activities/intransitive-activity.interface"), exports);

__exportStar(require("./collections/ordered-collection-page.interface"), exports);
__exportStar(require("./documents/article.interface"), exports);
__exportStar(require("./documents/document.interface"), exports);
__exportStar(require("./documents/audio.interface"), exports);
__exportStar(require("./documents/image.interface"), exports);
__exportStar(require("./documents/note.interface"), exports);
__exportStar(require("./documents/page.interface"), exports);
__exportStar(require("./documents/video.interface"), exports);
{
"name": "activitypub-types",
"version": "1.0.3",
"version": "1.1.0",
"description": "ActivityPub Typescript types",

@@ -26,4 +26,2 @@ "main": "./dist/index.js",

"dist",
"LICENSE",
"README.md",
"package.json",

@@ -30,0 +28,0 @@ "package-lock.json"

# ActivityPub Types
Extracted types and refactor from [activitypub-models](https://github.com/SiranWeb/activitypub-models) repo.
TypeScript typings for ActivityPub

@@ -11,18 +11,70 @@ ## Installation

## Available types
## How to use
Implemented and documented every structure from [specification](https://www.w3.org/TR/activitystreams-vocabulary).
You can use interfaces and extend them by yourself, or you can use specified fields types:
You can use interfaces and extend them by yourself, or you can use specified fields types.
To specify object use correct type:
```ts
import { APAdd } from 'activitypub-types';
const addActivity: APAdd = {
type: 'Add',
actor: 'https://actor.example.org',
// ...
}
```
Fields in types are pretty flexible, so you can pass different variations:
```ts
import { APAdd, APActor } from 'activitypub-types';
const actor1 = 'https://actor.example.org';
const actor2: APActor = {
type: 'Person',
id: 'https://actor2.example.org',
summary: 'Another actor',
inbox: 'https://actor2.example.org/inbox',
outbox: 'https://actor2.example.org/outbox',
};
const addActivity: APAdd = {
type: 'Add',
actor: [actor1, actor2],
// ...
};
```
To provide `@context` field use `APRoot`:
```typescript
// All models interfaces starts with AP
import { APObject, APNote, ContextField, ContentMapField } from 'activitypub-types';
import { APAdd, APRoot } from 'activitypub-types';
const addActivity: APRoot<APAdd> = {
'@context': 'https://www.w3.org/ns/activitystreams',
type: 'Add',
// ...
}
```
If you need field types themselves, you can import as well:
```typescript
import { TypeField, NameField } from 'activitypub-types';
interface APExample {
type: TypeField;
name?: NameField;
// ...
}
```
## Changelog
### v1.1.0
- Update activities and documents types ([#3](https://github.com/siranweb/activitypub-types/pull/3), by [@Saiv46](https://github.com/Saiv46))
- Add `APRoot` type and removed `@context` from `APObject` ([#5](https://github.com/siranweb/activitypub-types/pull/5))
- Improve AP documentation ([#3](https://github.com/siranweb/activitypub-types/pull/3), by [@Saiv46](https://github.com/Saiv46))
- Update README docs
- Refactor ([#3](https://github.com/siranweb/activitypub-types/pull/3), by [@Saiv46](https://github.com/Saiv46))
### v1.0.3
- Use `orderedItems` instead of `items` in `OrderedCollection` ([#1](https://github.com/siranweb/activitypub-types/pull/1), thanks [@RangerMauve](https://github.com/RangerMauve))
- Use `orderedItems` instead of `items` in `OrderedCollection` ([#1](https://github.com/siranweb/activitypub-types/pull/1), by [@RangerMauve](https://github.com/RangerMauve))
## Contact
You can contact me via [matrix](https://matrix.to/#/@siranweb:matrix.org) or [telegram](https://t.me/siranweb)
## License
[MIT](LICENSE)
[MIT](LICENSE)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc