1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00

removed boris reducer

This commit is contained in:
Fedor Katurov 2022-01-02 21:28:31 +07:00
parent 77af1ab05a
commit 120bf8954c
72 changed files with 225 additions and 298 deletions

47
src/types/boris/index.ts Normal file
View file

@ -0,0 +1,47 @@
export interface GithubIssue {
id: string;
url: string;
html_url: string;
body: string;
title: string;
state: 'open' | 'closed';
created_at: string;
pull_request?: unknown;
}
export type IGetGithubIssuesResult = GithubIssue[];
export type IStatGitRow = {
commit: string;
subject: string;
timestamp: string;
};
export type StatBackend = {
users: {
total: number;
alive: number;
};
nodes: {
images: number;
audios: number;
videos: number;
texts: number;
total: number;
};
comments: {
total: number;
};
files: {
count: number;
size: number;
};
};
export interface BorisUsageStats {
issues: GithubIssue[];
backend: StatBackend;
}
export type IBorisState = Readonly<{
stats: BorisUsageStats;
}>;

93
src/types/node/index.ts Normal file
View file

@ -0,0 +1,93 @@
import { IComment, INode, ITag } from '~/redux/types';
export interface IEditorComponentProps {}
export type GetNodeDiffRequest = {
start?: string;
end?: string;
take?: number;
with_heroes: boolean;
with_updated: boolean;
with_recent: boolean;
with_valid: boolean;
};
export type GetNodeDiffResult = {
before?: INode[];
after?: INode[];
heroes?: INode[];
recent?: INode[];
updated?: INode[];
valid: INode['id'][];
};
export type PostCellViewRequest = {
id: INode['id'];
flow: INode['flow'];
};
export type PostCellViewResult = unknown; // TODO: update it with actual type
export type ApiGetNodeRequest = {
id: string | number;
};
export type ApiGetNodeResponse = { node: INode; last_seen?: string };
export type ApiGetNodeRelatedRequest = {
id: INode['id'];
};
export type ApiGetNodeRelatedResult = {
related: INodeRelated;
};
export type ApiPostCommentRequest = {
id: INode['id'];
data: IComment;
};
export type ApiPostCommentResult = {
comment: IComment;
};
export type ApiPostNodeTagsRequest = {
id: INode['id'];
tags: string[];
};
export type ApiPostNodeTagsResult = {
node: INode;
};
export type ApiDeleteNodeTagsRequest = {
id: INode['id'];
tagId: ITag['ID'];
};
export type ApiDeleteNodeTagsResult = {
tags: ITag[];
};
export type ApiPostNodeLikeRequest = { id: INode['id'] };
export type ApiPostNodeLikeResult = { is_liked: boolean };
export type ApiPostNodeHeroicRequest = { id: INode['id'] };
export type ApiPostNodeHeroicResponse = { is_heroic: boolean };
export type ApiLockNodeRequest = {
id: INode['id'];
is_locked: boolean;
};
export type ApiLockNodeResult = {
deleted_at: string;
};
export type ApiLockCommentRequest = {
id: IComment['id'];
nodeId: INode['id'];
isLocked: boolean;
};
export type ApiLockcommentResult = {
deleted_at: string;
};
export type NodeEditorProps = {};
export type INodeRelated = {
albums: Record<string, INode[]>;
similar: INode[];
};