Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Add appLink and appGroup #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
42 changes: 42 additions & 0 deletions src/types/appGroup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { Collection, Attrs, Serializable } from "./collection";
import { AppLink } from "./appLink";

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

static schemaVersion = "1.0";

static schema = {
schemaVersion: String,
identifier: String,
name: String,
apps: Array(AppLink),
description: String
};

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

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

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

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

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

toJSON() {
return JSON.stringify(this.attrs);
}
}
41 changes: 41 additions & 0 deletions src/types/appLink.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { Collection, Attrs, Serializable } from "./collection";

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

static schemaVersion = "1.0";

static schema = {
schemaVersion: String,
identifier: String, // auth domain
name: String,
url: String,
description: String
};

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

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

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

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

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

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