Initial project
This commit is contained in:
21
src/types/Common.ts
Normal file
21
src/types/Common.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import { UserView } from "../../../timi-web";
|
||||
|
||||
export type ActionLogView = {
|
||||
|
||||
repoId: number;
|
||||
repoName: string;
|
||||
refName: string;
|
||||
operatedAt: number;
|
||||
|
||||
operator: UserView;
|
||||
commitList?: ActionLogCommit[];
|
||||
}
|
||||
|
||||
export type ActionLogCommit = {
|
||||
|
||||
sha: string;
|
||||
|
||||
message: string;
|
||||
|
||||
committedAt: number;
|
||||
}
|
||||
49
src/types/Issue.ts
Normal file
49
src/types/Issue.ts
Normal file
@ -0,0 +1,49 @@
|
||||
import { Attachment, Model, Page as BasePage, UserView } from "timi-web";
|
||||
|
||||
export type Issue = {
|
||||
repositoryId?: number;
|
||||
publisherId?: number;
|
||||
publisherNick?: string;
|
||||
type?: Type;
|
||||
version?: string;
|
||||
title: string;
|
||||
description: string;
|
||||
status?: Status;
|
||||
confirmedAt?: number;
|
||||
developAt?: number;
|
||||
closedAt?: number;
|
||||
} & Model;
|
||||
|
||||
export type IssueView = {
|
||||
|
||||
publisher?: UserView;
|
||||
|
||||
attachmentList: Attachment[]
|
||||
} & Issue;
|
||||
|
||||
export enum Type {
|
||||
BUG = "异常",
|
||||
FEATURE = "功能",
|
||||
SECURITY = "安全",
|
||||
QUESTION = "问题",
|
||||
DISCUSS = "讨论",
|
||||
}
|
||||
|
||||
export enum Status {
|
||||
BEFORE_CONFIRM = "待确认",
|
||||
CONFIRMED = "已确认",
|
||||
DEVELOPING = "开发中",
|
||||
FINISHED = "已完成",
|
||||
CLOSED = "已关闭",
|
||||
}
|
||||
|
||||
export type Page = {
|
||||
repositoryId?: number;
|
||||
keyword?: string;
|
||||
type?: Type;
|
||||
status?: Status;
|
||||
} & BasePage;
|
||||
|
||||
export type CommentPage = {
|
||||
issueId?: number;
|
||||
} & BasePage;
|
||||
52
src/types/Merge.ts
Normal file
52
src/types/Merge.ts
Normal file
@ -0,0 +1,52 @@
|
||||
import { IssueView } from "./Issue";
|
||||
import { Attachment, Model, Page as BasePage, UserView } from "timi-web";
|
||||
|
||||
export type Merge = {
|
||||
repositoryId?: number;
|
||||
requesterId?: number;
|
||||
issueId?: number;
|
||||
type?: Type;
|
||||
fromBranch?: string;
|
||||
toBranch: string;
|
||||
title: string;
|
||||
description: string;
|
||||
checkedAt?: number;
|
||||
mergedAt?: number;
|
||||
rejectedAt?: number;
|
||||
rejectReason?: string;
|
||||
closedAt?: number;
|
||||
status?: Status;
|
||||
} & Model;
|
||||
|
||||
export type MergeView = {
|
||||
requester?: UserView;
|
||||
issue?: IssueView;
|
||||
attachmentList: Attachment[]
|
||||
} & Merge;
|
||||
|
||||
export enum Type {
|
||||
BUG = "异常",
|
||||
FEATURE = "功能",
|
||||
SECURITY = "安全",
|
||||
DOCUMENT = "文档",
|
||||
REFACTOR = "重构",
|
||||
}
|
||||
|
||||
export enum Status {
|
||||
BEFORE_CHECK = "待审查",
|
||||
WAITING = "待合并",
|
||||
MERGED = "已合并",
|
||||
REJECTED = "已拒绝",
|
||||
CLOSED = "已关闭",
|
||||
}
|
||||
|
||||
export type Page = {
|
||||
repositoryId?: number;
|
||||
keyword?: string;
|
||||
type?: Type;
|
||||
status?: Status;
|
||||
} & BasePage;
|
||||
|
||||
export type CommentPage = {
|
||||
mergeId?: number;
|
||||
} & BasePage;
|
||||
15
src/types/Release.ts
Normal file
15
src/types/Release.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import { AttachmentView, Model, Page as BasePage } from "timi-web";
|
||||
|
||||
export type Release = {
|
||||
repositoryId: number;
|
||||
version: string;
|
||||
description: string;
|
||||
sha1: string;
|
||||
commits: number;
|
||||
|
||||
attachmentList: AttachmentView[];
|
||||
} & Model;
|
||||
|
||||
export type Page = {
|
||||
repositoryId?: number;
|
||||
} & BasePage;
|
||||
63
src/types/Repository.ts
Normal file
63
src/types/Repository.ts
Normal file
@ -0,0 +1,63 @@
|
||||
import { Model, Page, UserView } from "timi-web";
|
||||
|
||||
export type Repository = {
|
||||
id: number;
|
||||
name: string;
|
||||
description: string;
|
||||
size: number;
|
||||
language: string;
|
||||
sshUrl: string;
|
||||
cloneUrl: string;
|
||||
defaultBranch: string;
|
||||
archived: boolean;
|
||||
createdAt: number;
|
||||
updatedAt: number;
|
||||
archiveAt: string;
|
||||
license?: string[];
|
||||
}
|
||||
|
||||
export type RepositoryView = {
|
||||
branchList: Branch[];
|
||||
} & Repository;
|
||||
|
||||
export type Branch = {
|
||||
name: string;
|
||||
protected: boolean;
|
||||
}
|
||||
|
||||
export type Commit = {
|
||||
id: string;
|
||||
msg: string;
|
||||
time: number;
|
||||
|
||||
committer: UserView;
|
||||
}
|
||||
|
||||
export type CommitLog = {
|
||||
pushId: number;
|
||||
sha1: string;
|
||||
message: string;
|
||||
} & Model;
|
||||
|
||||
export type CommitPage = {
|
||||
repositoryId?: number;
|
||||
branch?: string;
|
||||
} & Page;
|
||||
|
||||
export enum FileType {
|
||||
|
||||
FILE = "file",
|
||||
DIRECTORY = "dir"
|
||||
}
|
||||
|
||||
export type File = {
|
||||
name: string;
|
||||
path: string;
|
||||
type: FileType
|
||||
sha: string;
|
||||
size: number;
|
||||
lastCommitSha: string;
|
||||
lastCommitterDate: number;
|
||||
|
||||
children: boolean;
|
||||
}
|
||||
Reference in New Issue
Block a user