Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
MacFJA committed Jul 7, 2024
1 parent cd1960e commit 89ed734
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion packages/service/src/services/repository-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,29 @@ import { ComposedService, type ContentData, type ServiceInterface, type ServiceM

export const TYPE = "repository" as const;

/**
* Code repository service.
*
* Get information about repository
*/
export class RepositoryService extends ComposedService<{ cover: string }> {
constructor() {
super([new GithubRepositoryService()], false);
}
}

/**
* Github repository service.
*
* Read information from a Github repository.
* - Repository name
* - Repository owner
* - Repository description
* - Date of the last commit on the default branch
* - List of topics
* - Cover picture of the repository
*
*/
class GithubRepositoryService implements ServiceInterface<{ cover: string }> {
canHandle(metadata: ServiceMetadata): Promise<boolean> {
const isGithub = metadata.identifier.includes("github.com") ?? false;
Expand Down Expand Up @@ -36,7 +53,7 @@ class GithubRepositoryService implements ServiceInterface<{ cover: string }> {
}
}

export type GithubStatResponse = {
type GithubStatResponse = {
id: number;
node_id: string;
name: string;
Expand Down

0 comments on commit 89ed734

Please sign in to comment.