GitFOSS
.ts
TypeScript
(application/typescript)
// 1st-party
import { GitServer } from "@ethicdevs/fastify-git-server";
import { ServiceApiContract } from "@ethicdevs/react-monolith";
// 3rd-party
import { FastifyRequest } from "fastify";
// app
import { CryptoServiceAPI } from "../crypto/types";

export interface GitServerServiceAPI extends ServiceApiContract {
  authorizationResolver(
    repoSlug: string,
    credentials: GitServer.AuthCredentials
  ): PromiseLike<boolean>;
  repositoryResolver(
    repoSlug: string
  ): PromiseLike<GitServer.RepositoryResolverResult>;
  onPushEvent(event: GitServer.Event): void;
}

export interface GitServerServiceDeps {
  cryptoService: CryptoServiceAPI;
  request: FastifyRequest;
}