You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
692 B

  1. import {Uuid} from '@theoryofnekomata/uuid-buffer';
  2. import {Org, User} from '../common';
  3. export enum RepoVisibility {
  4. PRIVATE,
  5. INTERNAL,
  6. PUBLIC,
  7. }
  8. export enum OwnerType {
  9. USER,
  10. ORG,
  11. }
  12. export type Owner = User | Org;
  13. export enum GitAction {
  14. REPO_CREATED = 'REPO_CREATED',
  15. REPO_REMOVED = 'REPO_REMOVED',
  16. }
  17. export type Repo = {
  18. id: Uuid,
  19. name: string,
  20. ownerId: Uuid,
  21. ownerType: OwnerType,
  22. visibility: RepoVisibility,
  23. }
  24. export type CreateRepoData = Omit<Repo, 'id'>;
  25. export class UnknownOwnerTypeError extends Error {}
  26. export class UserNotFoundError extends Error {}
  27. export class OrgNotFoundError extends Error {}
  28. export class RepoNotFoundError extends Error {}