add actor basic

pull/3/head
SiRanWeb 2022-11-02 17:00:47 +03:00
rodzic 602a1ab927
commit 983f5110d5
3 zmienionych plików z 51 dodań i 2 usunięć

Wyświetl plik

@ -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
})
}
}

Wyświetl plik

@ -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;
}

Wyświetl plik

@ -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.