mirror of
https://github.com/gitpod-io/gitpod.git
synced 2025-12-08 17:36:30 +00:00
This commit includes the following commits: - @iqqbot update dev image to nodejs v16lts - @iqqbot update dev-environment-image to use nodejs v16 - @iqqbot update component to nodejs v16 lts - [licensor] Adjust to v16 - [ts] Bump @types/node to ^16.11.0 accordingly - @aledbf Update typescript dependencies - @aledbf Update typescript configuration - @aledbf / @geropl Update typescript code - [server] Fix express/passport types - [db] typeorm upgrade 0.1.20 -> 0.2.22: fix compile and runtime issues - [db] typeorm upgrade 0.2.22 -> 0.2.38: fix compile and runtime issues - [dev] Upgrade amqplib and smaller libs - [dev] Upgrade uuid - [dev] Update probot - [dev] Final yarn.lock
132 lines
3.0 KiB
TypeScript
132 lines
3.0 KiB
TypeScript
/**
|
|
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
|
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
* See License-AGPL.txt in the project root for license information.
|
|
*/
|
|
|
|
import { PrebuiltWorkspaceState } from "./protocol";
|
|
import { v4 as uuidv4 } from 'uuid';
|
|
|
|
export interface ProjectConfig {
|
|
'.gitpod.yml': string;
|
|
}
|
|
|
|
export interface Project {
|
|
id: string;
|
|
name: string;
|
|
slug?: string;
|
|
cloneUrl: string;
|
|
teamId?: string;
|
|
userId?: string;
|
|
appInstallationId: string;
|
|
config?: ProjectConfig;
|
|
creationTime: string;
|
|
/** This is a flag that triggers the HARD DELETION of this entity */
|
|
deleted?: boolean;
|
|
markedDeleted?: boolean;
|
|
}
|
|
|
|
export namespace Project {
|
|
export const create = (project: Omit<Project, 'id' | 'creationTime'>): Project => {
|
|
return {
|
|
...project,
|
|
id: uuidv4(),
|
|
creationTime: new Date().toISOString()
|
|
};
|
|
}
|
|
|
|
export interface Overview {
|
|
branches: BranchDetails[]
|
|
}
|
|
|
|
export interface BranchDetails {
|
|
name: string;
|
|
url: string;
|
|
isDefault: boolean;
|
|
|
|
// Latest commit
|
|
changeTitle: string;
|
|
changeDate?: string;
|
|
changeAuthor?: string;
|
|
changeAuthorAvatar?: string;
|
|
changePR?: string;
|
|
changeUrl?: string;
|
|
changeHash: string;
|
|
}
|
|
}
|
|
|
|
export interface PrebuildWithStatus {
|
|
info: PrebuildInfo;
|
|
status: PrebuiltWorkspaceState;
|
|
error?: string;
|
|
}
|
|
|
|
export interface PrebuildInfo {
|
|
id: string;
|
|
buildWorkspaceId: string;
|
|
|
|
teamId?: string;
|
|
userId?: string;
|
|
|
|
projectId: string;
|
|
projectName: string;
|
|
|
|
cloneUrl: string;
|
|
branch: string;
|
|
|
|
startedAt: string;
|
|
startedBy: string;
|
|
startedByAvatar?: string;
|
|
|
|
changeTitle: string;
|
|
changeDate: string;
|
|
changeAuthor: string;
|
|
changeAuthorAvatar?: string;
|
|
changePR?: string;
|
|
changeUrl?: string;
|
|
changeHash: string;
|
|
}
|
|
export namespace PrebuildInfo {
|
|
export function is(data?: any): data is PrebuildInfo {
|
|
return typeof data === "object" && ["id", "buildWorkspaceId", "projectId", "branch"].every(p => p in data);
|
|
}
|
|
}
|
|
|
|
export interface StartPrebuildResult {
|
|
prebuildId: string;
|
|
wsid: string;
|
|
done: boolean;
|
|
}
|
|
|
|
export interface Team {
|
|
id: string;
|
|
name: string;
|
|
slug: string;
|
|
creationTime: string;
|
|
markedDeleted?: boolean;
|
|
/** This is a flag that triggers the HARD DELETION of this entity */
|
|
deleted?: boolean;
|
|
}
|
|
|
|
export type TeamMemberRole = "owner" | "member";
|
|
|
|
export interface TeamMemberInfo {
|
|
userId: string;
|
|
fullName?: string;
|
|
primaryEmail?: string;
|
|
avatarUrl?: string;
|
|
role: TeamMemberRole;
|
|
memberSince: string;
|
|
}
|
|
|
|
export interface TeamMembershipInvite {
|
|
id: string;
|
|
teamId: string;
|
|
role: TeamMemberRole;
|
|
creationTime: string;
|
|
invalidationTime: string;
|
|
invitedEmail?: string;
|
|
|
|
/** This is a flag that triggers the HARD DELETION of this entity */
|
|
deleted?: boolean;
|
|
} |