feat(gitea): add domain model classes, helpers, and refactor GiteaClient internals; expand README with usage and docs
This commit is contained in:
19
ts/gitea.classes.tag.ts
Normal file
19
ts/gitea.classes.tag.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import type { IGiteaTag } from './gitea.interfaces.js';
|
||||
|
||||
export class GiteaTag {
|
||||
public readonly name: string;
|
||||
public readonly commitSha: string;
|
||||
|
||||
constructor(raw: IGiteaTag) {
|
||||
this.name = raw.name || '';
|
||||
this.commitSha = raw.commit?.sha || '';
|
||||
}
|
||||
|
||||
toJSON(): IGiteaTag {
|
||||
return {
|
||||
name: this.name,
|
||||
id: this.name,
|
||||
commit: { sha: this.commitSha },
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user