kopia lustrzana https://github.com/activitypub-js/activitypub-models
add actor basic
rodzic
602a1ab927
commit
983f5110d5
|
@ -0,0 +1,22 @@
|
|||
import {APBase} from "../apBase/APBase.model";
|
||||
import {ASModelType} from "../../common/common.types";
|
||||
import {ActorFields} from "./Actor.types";
|
||||
|
||||
/**
|
||||
* ActivityPub actors are generally one of the ActivityStreams Actor Types, but
|
||||
* they don't have to be. For example, a Profile object might be used as an actor,
|
||||
* or a type from an ActivityStreams extension. Actors are retrieved like any other
|
||||
* Object in ActivityPub. Like other ActivityStreams objects, actors have an id,
|
||||
* which is a URI. When entered directly into a user interface (for example on a
|
||||
* login form), it is desirable to support simplified naming.
|
||||
*
|
||||
* {@link https://www.w3.org/TR/activitypub/#actors Docs}
|
||||
*/
|
||||
export class Actor extends APBase<ActorFields>{
|
||||
constructor(fields: ActorFields) {
|
||||
super({
|
||||
type: ASModelType.Profile,
|
||||
...fields
|
||||
})
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
import {APObjectFields} from "../apObject/APObject.types";
|
||||
|
||||
// TODO edit
|
||||
type Endpoints = {
|
||||
proxyUrl?: any;
|
||||
oauthAuthorizationEndpoint?: any;
|
||||
oauthTokenEndpoint?: any;
|
||||
provideClientKey?: any;
|
||||
signClientKey?: any;
|
||||
sharedInbox?: any;
|
||||
}
|
||||
|
||||
export interface ActorFields extends APObjectFields {
|
||||
inbox: any;
|
||||
outbox: any;
|
||||
following?: any;
|
||||
followers?: any;
|
||||
liked?: any;
|
||||
streams?: any;
|
||||
|
||||
// TODO preferredUsername or preferredUsernameMap at one time
|
||||
|
||||
preferredUsername?: any;
|
||||
preferredUsernameMap?: any;
|
||||
endpoints?: any;
|
||||
|
||||
}
|
|
@ -47,13 +47,13 @@ export interface APObjectFields {
|
|||
/**
|
||||
* Identifies the {@link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-object Object}
|
||||
* type. Multiple values may be specified.
|
||||
* All objects must have type.
|
||||
* 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 AS Docs (@type)}
|
||||
*
|
||||
* {@link https://www.w3.org/TR/activitypub/#obj-id AP Docs}
|
||||
*/
|
||||
type: TypeValue | TypeValue[];
|
||||
type?: TypeValue | TypeValue[];
|
||||
|
||||
/**
|
||||
* Identifies resources attached or related to an object that potentially requires special handling.
|
||||
|
|
Ładowanie…
Reference in New Issue