Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions src/types/gitRepositories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { Collection, Attrs, Serializable } from "./collection";
import { Contact } from "./contact";

export class GitRepository extends Collection implements Serializable {
static get collectionName(): string {
return "gitRepository";
}

static schemaVersion = "1.0";

static schema = {
schemaVersion: String,
identifier: String,
name: String,
owner: Contact,
url: String,
description: String,
languages: Array,
};

constructor(attrs: Attrs = {}) {
super(attrs);
}

collectionName(): string {
return GitRepository.collectionName;
}

static fromData(data: string) {
return this.fromJSON(data);
}

static fromJSON(data: string) {
return new GitRepository(JSON.parse(data));
}

serialize() {
return this.toJSON();
}

toJSON() {
return JSON.stringify(this.attrs);
}
}