moeralib
Version:
Library to interact with Moera decentralized social network
1,806 lines • 148 kB
TypeScript
export type PrincipalValue = "none" | "private" | "admin" | "owner" | "secret" | "senior" | "enigma" | "major" | "signed" | "subscribed" | "public" | "unset" | string;
export type AskSubject = "subscribe" | "friend";
export type BlockedEntryOperation = "addComment" | "addReaction";
export type BlockedOperation = "reaction" | "comment" | "posting" | "visibility" | "instant";
export type BodyFormat = "message" | "application";
export type DraftType = "new-posting" | "posting-update" | "new-comment" | "comment-update";
export type NodeType = "regular" | "search" | "application";
export type OperationStatus = "waiting" | "added" | "started" | "succeeded" | "failed" | "unknown";
export type PrincipalFlag = "none" | "private" | "admin" | "owner" | "secret" | "senior" | "enigma" | "major" | "signed" | "subscribed" | "public" | "friends" | "unset";
export type PushContentType = "story-added" | "story-deleted" | "feed-updated";
export type PushRelayType = "fcm";
export type Scope = "none" | "identify" | "other" | "view-content" | "add-post" | "update-post" | "add-comment" | "update-comment" | "react" | "delete-own-content" | "delete-others-content" | "view-people" | "block" | "friend" | "remote-identify" | "drafts" | "view-feeds" | "update-feeds" | "name" | "plugins" | "view-profile" | "update-profile" | "sheriff" | "view-settings" | "update-settings" | "subscribe" | "tokens" | "user-lists" | "grant" | "upload-public-media" | "upload-private-media" | "lease-media" | "view-all" | "all";
export declare const SCOPE_VALUES: Record<Scope, number>;
export type SearchContentUpdateType = "block" | "comment-add" | "comment-update" | "comment-update-heading" | "comment-update-media" | "comment-update-media-text" | "comment-delete" | "friend" | "profile" | "posting-add" | "posting-update" | "posting-update-heading" | "posting-update-media" | "posting-update-media-text" | "posting-delete" | "reaction-add" | "reaction-delete" | "reactions-delete-all" | "subscribe" | "unblock" | "unfriend" | "unsubscribe";
export type SearchEngine = "google" | "bing" | "yandex";
export type SearchEntryType = "all" | "posting" | "comment";
export type SettingType = "bool" | "int" | "string" | "json" | "Duration" | "PrivateKey" | "PublicKey" | "Timestamp" | "UUID" | "Principal";
export type SheriffComplaintStatus = "posted" | "prepared" | "prepare-failed" | "not-found" | "invalid-target" | "not-original" | "not-sheriff" | "approved" | "rejected";
export type SheriffOrderCategory = "visibility";
export type SheriffOrderReason = "unlawful" | "defamatory" | "threat" | "spam" | "scam" | "malware" | "copyright" | "impersonating" | "privacy" | "other";
export type SourceFormat = "plain-text" | "html" | "markdown" | "html/visual" | "application";
export type StoryType = "asked-to-friend" | "asked-to-subscribe" | "blocked-user" | "blocked-user-in-posting" | "comment-added" | "comment-media-reaction-added-negative" | "comment-media-reaction-added-positive" | "comment-media-reaction-failed" | "comment-needs-approval" | "comment-post-task-failed" | "comment-reaction-added-negative" | "comment-reaction-added-positive" | "comment-reaction-task-failed" | "comment-update-task-failed" | "defrosting" | "friend-added" | "friend-deleted" | "friend-group-deleted" | "mention-comment" | "mention-posting" | "posting-added" | "posting-media-reaction-added-negative" | "posting-media-reaction-added-positive" | "posting-media-reaction-failed" | "posting-post-task-failed" | "posting-reaction-task-failed" | "posting-subscribe-task-failed" | "posting-update-task-failed" | "posting-updated" | "premoderated-comment-accepted" | "premoderated-comment-rejected" | "reaction-added-negative" | "reaction-added-positive" | "reminder-avatar" | "reminder-email" | "reminder-full-name" | "reminder-sheriff-allow" | "remote-comment-added" | "reply-comment" | "search-report" | "sheriff-complaint-added" | "sheriff-complaint-decided" | "sheriff-marked" | "sheriff-unmarked" | "subscriber-added" | "subscriber-deleted" | "unblocked-user" | "unblocked-user-in-posting";
export type SubscriptionReason = "user" | "mention" | "comment" | "auto";
export type SubscriptionType = "feed" | "posting" | "posting-comments" | "profile" | "search" | "user-list";
export type VerificationStatus = "running" | "correct" | "incorrect" | "error";
export interface CommentOperations {
/**
* view the comment
*/
view?: PrincipalValue | null;
/**
* edit the comment
*/
edit?: PrincipalValue | null;
/**
* delete the comment
*/
delete?: PrincipalValue | null;
/**
* view the comment's reactions
*/
viewReactions?: PrincipalValue | null;
/**
* view the comment's negative reactions
*/
viewNegativeReactions?: PrincipalValue | null;
/**
* view the number of the comment's reactions
*/
viewReactionTotals?: PrincipalValue | null;
/**
* view the number of the comment's negative reactions
*/
viewNegativeReactionTotals?: PrincipalValue | null;
/**
* view the relative number of different types of the comment's reactions
*/
viewReactionRatios?: PrincipalValue | null;
/**
* view the relative number of different types of the comment's negative reactions
*/
viewNegativeReactionRatios?: PrincipalValue | null;
/**
* add a reaction to the comment
*/
addReaction?: PrincipalValue | null;
/**
* add a negative reaction to the comment
*/
addNegativeReaction?: PrincipalValue | null;
/**
* override the permissions of the comment's reactions
*/
overrideReaction?: PrincipalValue | null;
}
export interface ContactOperations {
/**
* see the subscriber information
*/
viewFeedSubscriber?: PrincipalValue | null;
/**
* see the subscription information
*/
viewFeedSubscription?: PrincipalValue | null;
/**
* see the friend information
*/
viewFriend?: PrincipalValue | null;
/**
* see the friend-of information (this operation can be modified by admin only)
*/
viewFriendOf?: PrincipalValue | null;
/**
* see the blocking information (this operation can be modified by admin only)
*/
viewBlock?: PrincipalValue | null;
/**
* see the blocked-by information (this operation can be modified by admin only)
*/
viewBlockBy?: PrincipalValue | null;
}
export interface FeedOperations {
/**
* add stories to the feed
*/
add?: PrincipalValue | null;
}
export interface FriendOperations {
/**
* view the membership of the node in the group of friends
*/
view?: PrincipalValue | null;
}
export interface FriendGroupOperations {
/**
* view the group of friends
*/
view?: PrincipalValue | null;
}
export interface NodeNameOperations {
/**
* any modification of the node name, prolonging it etc.
*/
manage?: PrincipalValue | null;
}
export interface PeopleOperations {
/**
* view the list of subscribers
*/
viewSubscribers?: PrincipalValue | null;
/**
* view the list of subscriptions
*/
viewSubscriptions?: PrincipalValue | null;
/**
* view the list of friends
*/
viewFriends?: PrincipalValue | null;
/**
* view the list of those who added this node to friends
*/
viewFriendOfs?: PrincipalValue | null;
/**
* view the list of blocked nodes
*/
viewBlocked?: PrincipalValue | null;
/**
* view the list of those who blocked this node
*/
viewBlockedBy?: PrincipalValue | null;
/**
* view the number of subscribers
*/
viewSubscribersTotal?: PrincipalValue | null;
/**
* view the number of subscriptions
*/
viewSubscriptionsTotal?: PrincipalValue | null;
/**
* view the number of friends
*/
viewFriendsTotal?: PrincipalValue | null;
/**
* view the number of those who added this node to friends
*/
viewFriendOfsTotal?: PrincipalValue | null;
}
export interface PostingOperations {
/**
* view the posting
*/
view?: PrincipalValue | null;
/**
* edit the posting
*/
edit?: PrincipalValue | null;
/**
* delete the posting
*/
delete?: PrincipalValue | null;
/**
* view the posting's comments
*/
viewComments?: PrincipalValue | null;
/**
* add a comment to the posting
*/
addComment?: PrincipalValue | null;
/**
* publish a comment to the posting without premoderation
*/
trustComment?: PrincipalValue | null;
/**
* override the permissions of the posting's comments
*/
overrideComment?: PrincipalValue | null;
/**
* view the posting's reactions
*/
viewReactions?: PrincipalValue | null;
/**
* view the posting's negative reactions
*/
viewNegativeReactions?: PrincipalValue | null;
/**
* view the number of the posting's reactions
*/
viewReactionTotals?: PrincipalValue | null;
/**
* view the number of the posting's negative reactions
*/
viewNegativeReactionTotals?: PrincipalValue | null;
/**
* view the relative number of different types of the posting's reactions
*/
viewReactionRatios?: PrincipalValue | null;
/**
* view the relative number of different types of the posting's negative reactions
*/
viewNegativeReactionRatios?: PrincipalValue | null;
/**
* add a reaction to the posting
*/
addReaction?: PrincipalValue | null;
/**
* add a negative reaction to the posting
*/
addNegativeReaction?: PrincipalValue | null;
/**
* override the permissions of the posting's reactions
*/
overrideReaction?: PrincipalValue | null;
/**
* override the permissions of the posting's comment's reactions
*/
overrideCommentReaction?: PrincipalValue | null;
}
export interface PrivateMediaFileOperations {
/**
* view the media file
*/
view?: PrincipalValue | null;
/**
* edit the media file attributes
*/
edit?: PrincipalValue | null;
}
export interface ProfileOperations {
/**
* change the profile
*/
edit?: PrincipalValue | null;
/**
* view the e-mail address in the profile
*/
viewEmail?: PrincipalValue | null;
}
export interface ReactionOperations {
/**
* view the reaction
*/
view?: PrincipalValue | null;
/**
* delete the reaction
*/
delete?: PrincipalValue | null;
}
export interface SearchEntryOperations {
/**
* view the entry
*/
view?: PrincipalValue | null;
}
export interface StoryOperations {
/**
* update the story
*/
edit?: PrincipalValue | null;
/**
* delete the story
*/
delete?: PrincipalValue | null;
}
export interface SubscriberOperations {
/**
* see the subscriber
*/
view?: PrincipalValue | null;
/**
* delete the subscriber (this operation cannot be modified or overridden)
*/
delete?: PrincipalValue | null;
}
export interface SubscriptionOperations {
/**
* see the subscription
*/
view?: PrincipalValue | null;
/**
* delete the subscription (this operation cannot be modified or overridden)
*/
delete?: PrincipalValue | null;
}
export interface AskDescription {
/**
* request subject
*/
subject: AskSubject;
/**
* if the request is to add this node to friends, this field contains ID of the corresponding group of friends on
* the remote node
*/
friendGroupId?: string | null;
/**
* message to the node admin
*/
message?: string | null;
}
export interface AsyncOperationCreated {
/**
* ID of the asynchronous operation that was created
*/
id: string;
}
export interface AvatarAttributes {
/**
* ID of the public media file used as a source image
*/
mediaId: string;
/**
* x coordinate of the top-left corner of the clipping square
*/
clipX: number;
/**
* y coordinate of the top-left corner of the clipping square
*/
clipY: number;
/**
* size of the clipping square
*/
clipSize: number;
/**
* size of the avatar to be created
*/
avatarSize: number;
/**
* rotation angle of the source image
*/
rotate: number;
/**
* shape of the avatar
*/
shape?: string | null;
/**
* ordinal of the avatar
*/
ordinal?: number | null;
}
export interface AvatarDescription {
/**
* ID of the public media file used as an avatar image
*/
mediaId: string;
/**
* shape of the avatar
*/
shape: string;
/**
* if set to ``true``, the node will ignore the absence of the media file referenced in ``mediaId`` field (empty
* avatar will be used in this case); if set to ``false`` or absent, the node will return an error, if the media
* file referenced in ``mediaId`` field is absent
*/
optional?: boolean | null;
}
export interface AvatarImage {
/**
* ID of the media file
*/
mediaId: string;
/**
* virtual location of the media file, relative to the ``/media`` virtual page
*/
path: string;
/**
* location of the media file, relative to the ``/media``; points to a static image served directly from a
* filesystem or CDN
*/
directPath?: string | null;
/**
* direct path expiration timestamp - the real time when the direct path will not be valid anymore
*/
directPathExpiresAt?: number | null;
/**
* MIME type of the media
*/
mimeType?: string | null;
/**
* width of the media in pixels (``null``, if the media file is not an image/video)
*/
width?: number | null;
/**
* height of the media in pixels (``null``, if the media file is not an image/video)
*/
height?: number | null;
/**
* shape of the avatar
*/
shape?: string | null;
}
export interface AvatarInfo {
/**
* ID of the avatar
*/
id: string;
/**
* ID of the media file
*/
mediaId: string;
/**
* virtual location of the media file, relative to the ``/media`` virtual page
*/
path: string;
/**
* location of the media file, relative to the ``/media``; points to a static image served directly from a
* filesystem or CDN
*/
directPath?: string | null;
/**
* direct path expiration timestamp - the real time when the direct path will not be valid anymore
*/
directPathExpiresAt?: number | null;
/**
* MIME type of the media
*/
mimeType?: string | null;
/**
* width of the media in pixels (``null``, if the media file is not an image/video)
*/
width?: number | null;
/**
* height of the media in pixels (``null``, if the media file is not an image/video)
*/
height?: number | null;
/**
* shape of the avatar
*/
shape?: string | null;
/**
* ordinal of the avatar
*/
ordinal: number;
}
export interface AvatarOrdinal {
/**
* ID of the avatar
*/
id: string;
/**
* ordinal of the avatar
*/
ordinal: number;
}
export interface AvatarsOrdered {
/**
* IDs of avatars
*/
ids: string[];
}
export interface BlockedInstantAttributes {
/**
* type of the story
*/
storyType: StoryType;
/**
* ID of the local entry the blocked story should be related to
*/
entryId?: string | null;
/**
* node name of the remote posting the blocked story should be related to
*/
remoteNodeName?: string | null;
/**
* ID of the remote posting the blocked story should be related to
*/
remotePostingId?: string | null;
/**
* owner name of the remote object the blocked story should be related to
*/
remoteOwnerName?: string | null;
/**
* unblocking timestamp - the real time when the story will be unblocked; ``null`` or absent, if the story is
* blocked permanently
*/
deadline?: number | null;
}
export interface BlockedInstantFilter {
/**
* type of the story
*/
storyType: StoryType;
/**
* ID of the local entry the blocked story should be related to
*/
entryId?: string | null;
/**
* node name of the remote posting the blocked story should be related to
*/
remoteNodeName?: string | null;
/**
* ID of the remote posting the blocked story should be related to
*/
remotePostingId?: string | null;
/**
* owner name of the remote object the blocked story should be related to
*/
remoteOwnerName?: string | null;
}
export interface BlockedInstantInfo {
id: string;
/**
* type of the story
*/
storyType: StoryType;
/**
* ID of the local entry the blocked story should be related to
*/
entryId?: string | null;
/**
* node name of the remote posting the blocked story should be related to
*/
remoteNodeName?: string | null;
/**
* ID of the remote posting the blocked story should be related to
*/
remotePostingId?: string | null;
/**
* owner name of the remote object the blocked story should be related to
*/
remoteOwnerName?: string | null;
/**
* blocking timestamp - the real time when the story was blocked
*/
createdAt: number;
/**
* unblocking timestamp - the real time when the story will be unblocked; ``null`` or absent, if the story is
* blocked permanently
*/
deadline?: number | null;
}
export interface BlockedPostingInstantInfo {
id: string;
/**
* type of the story
*/
storyType: StoryType;
/**
* owner name of the remote object the blocked story should be related to
*/
remoteOwnerName?: string | null;
/**
* unblocking timestamp - the real time when the story will be unblocked; ``null`` or absent, if the story is
* blocked permanently
*/
deadline?: number | null;
}
export interface BlockedUserAttributes {
/**
* operation that is to be blocked
*/
blockedOperation: BlockedOperation;
/**
* name of the blocked node
*/
nodeName: string;
/**
* ID of the local entry, where the node is blocked; ``null`` or absent, if the node is blocked globally
*/
entryId?: string | null;
/**
* node name of the remote posting, where the node is blocked; ``null`` or absent, if the node is blocked globally
*/
entryNodeName?: string | null;
/**
* ID of the remote posting, where the node is blocked; ``null`` or absent, if the node is blocked globally
*/
entryPostingId?: string | null;
/**
* unblocking timestamp - the real time when the node will be unblocked; ``null`` or absent, if the node is blocked
* permanently
*/
deadline?: number | null;
/**
* source text of the reason of blocking
*/
reasonSrc?: string | null;
/**
* format of the source text of the reason of blocking, the list of available formats is returned in
* ``PostingFeatures``
*/
reasonSrcFormat?: SourceFormat | null;
}
export interface BlockedUserFilter {
/**
* operations that are blocked
*/
blockedOperations?: BlockedOperation[] | null;
/**
* name of the blocked node
*/
nodeName?: string | null;
/**
* ID of the local entry, where the node is blocked; ``null`` or absent, if the node is blocked globally
*/
entryId?: string | null;
/**
* node name of the remote posting, where the node is blocked; ``null`` or absent, if the node is blocked globally
*/
entryNodeName?: string | null;
/**
* ID of the remote posting, where the node is blocked; ``null`` or absent, if the node is blocked globally
*/
entryPostingId?: string | null;
/**
* if set to ``true``, only the blockings that strictly fit the criteria are returned; otherwise global blockings
* are returned even if the search is limited to a particular posting
*/
strict?: boolean | null;
}
export interface BlockedUsersChecksums {
/**
* checksum of the list of users that are hidden
*/
visibility: number;
}
export interface CarteAttributes {
/**
* permissions to be granted to the carte; if not set, all permissions of the carte's owner are granted
*/
clientScope?: Scope[] | null;
/**
* additional administrative permissions (of those granted to the carte's owner by the target node) to be granted
* to the carte
*/
adminScope?: Scope[] | null;
/**
* if set, the carte is valid for authentication on the specified node only
*/
nodeName?: string | null;
/**
* maximum number of sequential cartes to be returned; the node may decide to return fewer cartes than the given
* limit
*/
limit?: number | null;
}
export interface CarteInfo {
carte: string;
/**
* timestamp of the beginning of the carte's life
*/
beginning: number;
/**
* timestamp of the end of the carte's life
*/
deadline: number;
/**
* if set, the carte is valid for authentication on the specified node only
*/
nodeName?: string | null;
/**
* the list of permissions granted to the carte
*/
clientScope?: Scope[] | null;
/**
* the list of additional administrative permissions (of those granted to the carte's owner by the target node)
* granted to the carte
*/
adminScope?: Scope[] | null;
}
export interface CarteSet {
/**
* the client IP address the cartes are bound to
*/
cartesIp?: string | null;
/**
* the cartes
*/
cartes: CarteInfo[];
/**
* cartes creation timestamp
*/
createdAt: number;
}
export interface CarteVerificationInfo {
/**
* ``true``, if the carte can be accepted for authentication, ``false`` otherwise
*/
valid: boolean;
/**
* name of the node the carte authenticates
*/
clientName?: string | null;
/**
* the list of permissions granted to the carte
*/
clientScope?: Scope[] | null;
/**
* the list of additional administrative permissions (of those granted to the carte's owner by the target node)
* granted to the carte
*/
adminScope?: Scope[] | null;
/**
* error code
*/
errorCode?: string | null;
/**
* human-readable error message
*/
errorMessage?: string | null;
}
export interface ClientCarte {
/**
* the node name the client (carte owner) wants to authenticate under
*/
clientName?: string | null;
/**
* the carte to verify
*/
carte: string;
}
export interface ClientReactionInfo {
/**
* ``true``, if the reaction is negative, ``false``, if positive
*/
negative: boolean;
/**
* reaction code, usually interpreted by clients as emoji code point
*/
emoji: number;
/**
* reaction creation timestamp - the real time when the reaction was created
*/
createdAt: number;
/**
* if present, the reaction will be erased at this time
*/
deadline?: number | null;
}
export interface CommentTotalInfo {
/**
* total number of comments in the posting after the operation
*/
total: number;
}
export interface ContactFilter {
/**
* list of node names to fetch
*/
nodeNames: string[];
}
export interface ContactInfo {
nodeName: string;
fullName?: string | null;
gender?: string | null;
title?: string | null;
avatar?: AvatarImage | null;
/**
* social distance between the contact and the node, which depends on subscription and friendship status and the
* number recent reactions and comments
*/
distance: number;
/**
* the contact is subscribed to at least one of the node's feeds
*/
hasFeedSubscriber?: boolean | null;
/**
* the node is subscribed to at least one of the contact's feeds
*/
hasFeedSubscription?: boolean | null;
/**
* the contact is a friend of the node
*/
hasFriend?: boolean | null;
/**
* the node is a friend of the contact
*/
hasFriendOf?: boolean | null;
/**
* the contact is blocked by the node
*/
hasBlock?: boolean | null;
/**
* the node is blocked by the contact
*/
hasBlockBy?: boolean | null;
/**
* the supported operations and the corresponding principals
*/
operations?: ContactOperations | null;
/**
* the supported operations and the corresponding principals as defined by the contact's owner
*/
ownerOperations?: ContactOperations | null;
/**
* the operations and the corresponding principals that are overridden by the node administrator
*/
adminOperations?: ContactOperations | null;
}
export interface VisitedNodeAttributes {
/**
* name of the visited node
*/
nodeName: string;
}
export interface Credentials {
login: string;
password: string;
}
export interface CredentialsChange {
/**
* credentials reset token
*/
token?: string | null;
/**
* the current password
*/
oldPassword?: string | null;
login: string;
password: string;
}
export interface CredentialsCreated {
/**
* ``true`` if the credentials are initialized already, ``false`` otherwise
*/
created: boolean;
}
export interface CredentialsResetToken {
token: string;
}
export interface DeleteNodeStatus {
/**
* ``true`` if the request is sent, ``false`` otherwise
*/
requested: boolean;
}
export interface DeleteNodeText {
/**
* text message for the provider
*/
message?: string | null;
}
export interface DomainAttributes {
/**
* domain's hostname or ``_default_`` for the default domain
*/
name?: string | null;
/**
* domain's node ID
*/
nodeId?: string | null;
}
export interface DomainAvailable {
/**
* fully-qualified domain name
*/
name: string;
}
export interface DomainInfo {
/**
* domain's hostname or ``_default_`` for the default domain
*/
name: string;
/**
* domain's node ID
*/
nodeId: string;
/**
* domain creation timestamp
*/
createdAt: number;
}
export interface EmailHint {
/**
* a masked E-mail address that should help user to understand which E-mail address was used without revealing it
*/
emailHint: string;
}
export interface FeedReference {
/**
* name of the feed
*/
feedName: string;
/**
* story publication timestamp - the time the story is published under in the feed
*/
publishedAt: number;
/**
* ``true``, if the story is pinned (should appear before any non-pinned story in the feed), ``false`` otherwise
*/
pinned?: boolean | null;
moment: number;
/**
* ID of the story
*/
storyId: string;
/**
* the supported operations and the corresponding principals for the story in the feed
*/
operations?: StoryOperations | null;
}
export interface FeedStatus {
/**
* total number of stories
*/
total: number;
/**
* total number of pinned stories
*/
totalPinned: number;
/**
* moment of the most recent story
*/
lastMoment?: number | null;
/**
* number of stories that have not been viewed yet, admin only
*/
notViewed?: number | null;
/**
* number of stories that have not been read yet, admin only
*/
notRead?: number | null;
/**
* moment of the oldest non-viewed story, admin only
*/
notViewedMoment?: number | null;
/**
* moment of the oldest non-read story, admin only
*/
notReadMoment?: number | null;
}
export interface FeedStatusChange {
/**
* new value of the ``viewed`` flag (``null``, if the flag is not changed)
*/
viewed?: boolean | null;
/**
* new value of the ``read`` flag (``null``, if the flag is not changed)
*/
read?: boolean | null;
/**
* change flags for all stories before this moment, inclusive
*/
before: number;
}
export interface FeedWithStatus {
/**
* name of the feed
*/
feedName: string;
/**
* number of stories in the feed that have not been viewed yet
*/
notViewed: number;
/**
* number of stories in the feed that have not been read yet
*/
notRead: number;
/**
* moment of the oldest non-viewed story
*/
notViewedMoment?: number | null;
/**
* moment of the oldest non-read story
*/
notReadMoment?: number | null;
}
export interface FriendGroupAssignment {
/**
* ID of the group of friends
*/
id: string;
/**
* the operations and the corresponding principals
*/
operations?: FriendOperations | null;
}
export interface FriendGroupDescription {
/**
* title of the group of friends
*/
title: string;
/**
* the operations and the corresponding principals
*/
operations?: FriendGroupOperations | null;
}
export interface FriendGroupDetails {
/**
* ID of the group of friends
*/
id: string;
/**
* title of the group of friends
*/
title?: string | null;
/**
* the friendship timestamp - the real time when the node was added to the group of friends
*/
addedAt: number;
/**
* list of the supported operations and the corresponding principals
*/
operations?: FriendOperations | null;
}
export interface FriendGroupInfo {
id: string;
/**
* title of the group of friends
*/
title?: string | null;
/**
* the group creation timestamp - the real time when the group of friends was created
*/
createdAt: number;
/**
* list of the supported operations and the corresponding principals
*/
operations?: FriendGroupOperations | null;
}
export interface FriendGroupsFeatures {
/**
* list of groups of friends existing on the node
*/
available: FriendGroupInfo[];
/**
* list of groups of friends the client is member of
*/
memberOf?: FriendGroupDetails[] | null;
}
export interface FriendInfo {
/**
* name of the node
*/
nodeName: string;
/**
* information about the node
*/
contact?: ContactInfo | null;
/**
* groups of friends the node belongs to
*/
groups?: FriendGroupDetails[] | null;
}
export interface FriendOfInfo {
/**
* name of the remote node
*/
remoteNodeName: string;
/**
* information about the remote node
*/
contact?: ContactInfo | null;
/**
* groups of friends on the remote node this node was added to
*/
groups?: FriendGroupDetails[] | null;
}
export interface FundraiserInfo {
/**
* fundraiser title
*/
title: string;
/**
* text or URI to be encoded and displayed as QR-code
*/
qrCode?: string | null;
/**
* arbitrary text to be displayed
*/
text?: string | null;
/**
* link to the fundraiser
*/
href?: string | null;
}
export interface GrantChange {
/**
* a set of permissions to be granted or revoked
*/
scope: Scope[];
/**
* ``true`` if the permissions must be revoked, ``false`` if the permissions must be granted
*/
revoke: boolean;
}
export interface GrantInfo {
/**
* name of the node the permissions are granted to
*/
nodeName: string;
/**
* the set of administrative permissions granted to the node
*/
scope: Scope[];
}
export interface KeyMnemonic {
/**
* the words
*/
mnemonic: string[];
}
export interface LinkPreview {
/**
* name of the site
*/
siteName?: string | null;
/**
* canonical URL of the page
*/
url?: string | null;
/**
* title of the page
*/
title?: string | null;
/**
* description of the page
*/
description?: string | null;
/**
* hash of the image presenting the page
*/
imageHash?: string | null;
/**
* timestamp of the page publication time
*/
publishedAt?: number | null;
}
export interface MediaDownloadAttributes {
/**
* media grant allowing access to the media
*/
grant: string;
}
export interface MediaFilePreviewInfo {
/**
* the width the preview was prepared for viewing at
*/
targetWidth: number;
/**
* SHA-1 hash of the preview
*/
hash: string;
/**
* virtual location of the preview, relative to the ``/media`` virtual page
*/
path: string;
/**
* location of the preview, relative to the ``/media``; points to a static image served directly from a filesystem
* or CDN
*/
directPath?: string | null;
/**
* direct path expiration timestamp - the real time when the direct path will not be valid anymore
*/
directPathExpiresAt?: number | null;
/**
* MIME type of the preview
*/
mimeType: string;
/**
* actual width of the preview in pixels
*/
width: number;
/**
* actual height of the preview in pixels
*/
height: number;
/**
* ``true`` if the preview is identical to the original media, ``false`` otherwise
*/
original?: boolean | null;
}
export interface MediaLeaseAttributes {
/**
* name of the node that receives the lease
*/
nodeName: string;
/**
* ID of the media file
*/
mediaId: string;
/**
* ID of the posting used to verify access to the media file
*/
postingId?: string | null;
/**
* ID of the comment used to verify access to the media file
*/
commentId?: string | null;
}
export interface MediaUploadAttributes {
/**
* MIME type of the media source file
*/
mimeType: string;
/**
* title of the media file, may be used as an alternative to the file name
*/
title?: string | null;
/**
* full file size in bytes
*/
fileSize: number;
/**
* client-proposed chunk size in bytes
*/
chunkSize?: number | null;
}
export interface MediaUploadInfo {
/**
* upload ID
*/
id: string;
/**
* MIME type of the media source file
*/
mimeType?: string | null;
/**
* title of the media file, may be used as an alternative to the file name
*/
title?: string | null;
/**
* full file size in bytes
*/
fileSize: number;
/**
* chunk size in bytes
*/
chunkSize: number;
/**
* zero-based numbers of uploaded chunks, sorted in natural order
*/
uploadedChunks: number[];
/**
* upload expiration timestamp - the real time when the upload may be deleted
*/
deadline: number;
/**
* upload completion timestamp - the real time when all chunks were uploaded
*/
completedAt?: number | null;
}
export interface NameToRegister {
name: string;
}
export interface NotificationPacket {
/**
* ID of the notification packet on the sending node (used to filter out duplicates)
*/
id: string;
/**
* name of the sending node
*/
nodeName: string;
/**
* full name of the sending node
*/
fullName?: string | null;
/**
* gender of the sending node
*/
gender?: string | null;
/**
* avatar of the sending node
*/
avatar?: AvatarImage | null;
/**
* notification packet creation timestamp
*/
createdAt: number;
/**
* notification type
*/
type: string;
/**
* the notification, a string representation of a JSON structure (see Notifications page for details)
*/
notification: string;
/**
* the notification packet sender signature (use ``NotificationPacket`` fingerprint)
*/
signature: string;
/**
* signature version (i.e. fingerprint version)
*/
signatureVersion: number;
}
export interface NodeNameInfo {
name?: string | null;
/**
* status of the latest operation with the node name
*/
operationStatus?: OperationStatus | null;
/**
* the last time the operation status was updated
*/
operationStatusUpdated?: number | null;
/**
* if the operation with the node name was failed, the code of the failure
*/
operationErrorCode?: string | null;
/**
* if the operation with the node name was failed, the human-readable description of the failure
*/
operationErrorMessage?: string | null;
/**
* ``true``, if updating key mnemonic is being stored on the node, ``false`` otherwise
*/
storedMnemonic?: boolean | null;
/**
* the supported operations and the corresponding principals
*/
operations?: NodeNameOperations | null;
}
export interface ParentMediaInfo {
/**
* name of the node containing the media the posting is linked to; if ``null``, the media is located on the same
* node as the posting
*/
nodeName?: string | null;
/**
* ID of the media the posting is linked to; the media is located on the ``nodeName`` node
*/
mediaId: string;
/**
* ID of the posting that owns the attachment the posting is linked to; the posting is located at the same node as
* the posting
*/
postingId: string;
/**
* ID of the comment that owns the attachment the posting is linked to; if set, ``postingId`` contains ID of the
* parent posting of the comment; the comment is located at the same node as the posting
*/
commentId?: string | null;
}
export interface PeopleGeneralInfo {
/**
* total number of subscribers of the node
*/
feedSubscribersTotal?: number | null;
/**
* total number of subscriptions of the node
*/
feedSubscriptionsTotal?: number | null;
/**
* total number of friends in every group
*/
friendsTotal?: Partial<Record<string, number>> | null;
/**
* total number of nodes that added this node to their friends
*/
friendOfsTotal?: number | null;
/**
* total number of blocked nodes
*/
blockedTotal?: number | null;
/**
* total number of nodes that blocked this node
*/
blockedByTotal?: number | null;
/**
* the supported operations and the corresponding principals
*/
operations?: PeopleOperations | null;
}
export interface PluginContext {
/**
* ``true``, if the client has authenticated as root admin, ``false`` otherwise
*/
rootAdmin: boolean;
/**
* ``true``, if the client has authenticated as node admin, ``false`` otherwise
*/
admin: boolean;
/**
* the list of permissions granted to the client, if it has authenticated as node admin; see
* ``TokenInfo.permissions`` for the list of possible values
*/
authCategories: string[];
/**
* node name of the client
*/
clientName: string;
/**
* IP address of the client
*/
remoteAddress: string;
/**
* user agent (browser) used by the client
*/
userAgent: string;
/**
* operating system used by the client
*/
userAgentOs: string;
/**
* ID of the current node
*/
nodeId: string;
/**
* node name of the current node
*/
nodeName: string;
/**
* domain name of the current node
*/
domainName: string;
/**
* full URL of the request
*/
originUrl: string;
}
export interface PostingFeatures {
/**
* ``true`` if the client is allowed to create postings, ``false`` otherwise
*/
post?: boolean | null;
/**
* ``true`` if new postings are recommended to have a subject, ``false`` otherwise
*/
subjectPresent: boolean;
/**
* list of source text formats the node understands
*/
sourceFormats: SourceFormat[];
/**
* list of image formats (in MIME type form) the node understands
*/
imageFormats: string[];
}
export interface PostingSourceInfo {
/**
* name of the remote node
*/
nodeName: string;
/**
* full name of the remote node
*/
fullName?: string | null;
/**
* avatar of the remote node
*/
avatar?: AvatarImage | null;
/**
* name of the feed on the remote node
*/
feedName: string;
/**
* ID of the posting on the remote node
*/
postingId: string;
/**
* timestamp when the posting was received from this source
*/
createdAt: number;
}
export interface PrivateMediaFileAttributes {
/**
* title of the media file, may be used as an alternative to the file name
*/
title?: string | null;
}
export interface PrivateMediaFileInfo {
/**
* ID of the media file
*/
id: string;
/**
* SHA-1 hash of the media file
*/
hash: string;
/**
* cryptographic digest of the media file
*/
digest: string;
/**
* virtual location of the media file, relative to the ``/media`` virtual page
*/
path: string;
/**
* location of the media file, relative to the ``/media``; points to a static image served directly from a
* filesystem or CDN
*/
directPath?: string | null;
/**
* direct path expiration timestamp - the real time when the direct path will not be valid anymore
*/
directPathExpiresAt?: number | null;
/**
* MIME type of the media
*/
mimeType: string;
/**
* width of the media in pixels (``null``, if the media file is not an image or video)
*/
width: number;
/**
* height of the media in pixels (``null``, if the media file is not an image or video)
*/
height: number;
/**
* media orientation, the value should be interpreted like the orientation value present in JPEG EXIF data
* (``null``, if the media file is not an image or video)
*/
orientation: number;
/**
* size of the media file in bytes
*/
size: number;
/**
* title of the media file, may be used as an alternative to the file name
*/
title?: string | null;
/**
* the text contained in the image, if any
*/
textContent?: string | null;
/**
* list of media previews - downscaled versions of the media
*/
previews?: MediaFilePreviewInfo[] | null;
/**
* ``true`` if the media cannot be displayed as an image or video and should be displayed as an attachment instead,
* ``false`` (default) otherwise
*/
attachment?: boolean | null;
/**
* ``true`` if the media file is considered to be malware, ``false`` (default) otherwise
*/
malware?: boolean | null;
/**
* media grant allowing access to the media
*/
grant?: string | null;
/**
* grant expiration timestamp - the real time when the grant will not be valid anymore
*/
grantExpiresAt?: number | null;
/**
* the supported operations and the corresponding principals
*/
operations?: PrivateMediaFileOperations | null;
}
export interface ProfileAttributes {
/**
* node owner's full name
*/
fullName?: string | null;
/**
* node owner's gender
*/
gender?: string | null;
/**
* node owner's E-mail address
*/
email?: string | null;
/**
* node title
*/
title?: string | null;
/**
* the source text of node owner's bio (arbitrary text)
*/
bioSrc?: string | null;
/**
* format of the source text of node owner's bio, ``markdown`` by default; the list of available formats is
* returned in ``PostingFeatures``
*/
bioSrcFormat?: SourceFormat | null;
/**
* node owner's avatar ID
*/
avatarId?: string | null;
/**
* list of fundraisers - methods of giving a donation to the node owner
*/
fundraisers?: FundraiserInfo[] | null;
/**
* the operations and the corresponding principals
*/
operations?: ProfileOperations | null;
}
export interface ProfileInfo {
/**
* node owner's full name
*/
fullName?: string | null;
/**
* node owner's gender
*/
gender?: string | null;
/**
* node owner's E-mail address
*/
email?: string | null;
/**
* ``true``, if the node owner's E-mail address is verified, ``false`` otherwise
*/
emailVerified?: boolean | null;
/**
* node title
*/
title?: string | null;
/**
* the source text of node owner's bio (arbitrary text), may be absent if not requested
*/
bioSrc?: string | null;
/**
* format of the source text of node owner's bio, ``markdown`` by default, may be absent if not requested; the list
* of available formats is returned in ``PostingFeatures``
*/
bioSrcFormat?: SourceFormat | null;
/**
* HTML representation of node owner's bio
*/
bioHtml?: string | null;
/**
* node owner's avatar
*/
avatar?: AvatarInfo | null;
/**
* list of fundraisers - methods of giving a donation to the node owner
*/
fundraisers?: FundraiserInfo[] | null;
/**
* the supported operations and the corresponding principals
*/
operations?: ProfileOperations | null;
}
export interface PublicMediaFileInfo {
/**
* ID of the media file
*/
id: string;
/**
* virtual location of the media file, relative to the ``/media`` virtual page
*/
path: string;
/**
* location of the media file, relative to the ``/media``; points to a static image served directly from a
* filesystem or CDN
*/
directPath?: string | null;
/**
* direct path expiration timestamp - the real time when the direct path will not be valid anymore
*/
directPathExpiresAt?: number | null;
/**
* MIME type of the media
*/
mimeType?: string | null;
/**
* width of the media in pixels (``null``, if the media file is not an image or video)
*/
width?: number | null;
/**
* height of the media in pixels (``null``, if the media file is not an image or video)
*/
height?: number | null;
/**
* media orientation, the value should be interpreted like the orientation value present in JPEG EXIF data
* (``null``, if the media file is not an image or video)
*/
orientation?: number | null;
/**
* size of the media file in bytes
*/
size: number;
}
export interface PushRelayClientAttributes {
/**
* type of the relay
*/
type: PushRelayType;
/**
* ID/token of the client
*/
clientId: string;
/**
* language of the messages
*/
lang?: string | null;
}
export interface ReactionAttributes {
/**
* ``true``, if the reaction is negative, ``false``, if positive
*/
negative: boolean;
/**
* reaction code, usually interpreted by clients as emoji code point
*/
emoji: number;
/**
* the operations and the corresponding principals
*/
operations?: ReactionOperations | null;
}
export interface ReactionDescription {
/**
* reaction owner's node name
*/
ownerName?: string | null;
/**
* reaction owner's full name
*/
ownerFullName?: string | null;
/**
* reaction owner's gender
*/
ownerGender?: string | null;
/**
* reaction owner's avatar
*/
ownerAvatar?: AvatarDescription | null;
/**
* ``true``, if the reaction is negative, ``false``, if positive
*/
negative: boolean;
/**
* reaction code, usually interpreted by clients as emoji code point
*/
emoji: number;
/**
* the reaction owner signature (use ``Reaction`` fingerprint)
*/
signature?: string | null;
/**
* signature version (i.e. fingerprint version)
*/
signatureVersion?: number | null;
/**
* the operations and the corresponding principals
*/
operations?: ReactionOperations | null;
}
export interface ReactionsFilter {
/**
* reaction owner's name
*/
ownerName?: string | null;
/**
* list of IDs of postings
*/
postings?: string[] | null;
}
export interface ReactionInfo {
/**
* reaction owner's node name
*/
ownerName?: string | null;
/**
* reaction owner's full name
*/
ownerFullName?: string | null;
/**
* reaction owner's gender
*/
ownerGender?: string | null;
/**
* reaction owner's avatar
*/
ownerAvatar?: AvatarImage | null;
/**
* ID of the posting
*/
postingId?: string | null;
/**
* ID of the posting revision, if relevant
*/
postingRevisionId?: string | null;
/**
* ID of the comment, if relevant
*/
commentId?: string | null;
/**
* ID of the comment revision, if relevant
*/
commentRevisionId?: string | null;
/**
* ``true``, if the reaction is negative, ``false``, if positive
*/
negative?: boolean | null;
/**
* reaction code, usually interpreted by clients as emoji code point
*/
emoji?: number | null;
moment?: number | null;
/**
* reaction creation timestamp - the real time when the reaction was created
*/
createdAt?: number | null;
/**
* if present, the reaction will be erased at this time
*/
deadline?: number | null;
/**
* the reaction own