Skip to content
This repository has been archived by the owner on Jul 7, 2021. It is now read-only.

Commit

Permalink
refactor(profiles): update plugin interface to include plugin data
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Faust committed Aug 21, 2020
1 parent 7d6fbee commit 138a5aa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ import { container } from "../environment/container";
import { Identifiers } from "../environment/container.models";
import { PluginRepository } from "./plugin-repository";

const stubPlugin = { id: 1, name: "@hello/world" };
const stubPlugin = {
id: 1,
name: "@hello/world",
version: "1.0.0",
isEnabled: true,
permissions: ["something"],
urls: "https://google.com",
};

let subject: PluginRepository;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ import { container } from "../environment/container";
import { Identifiers } from "../environment/container.models";
import { DataRepository } from "./data-repository";

// TODO: this is a placeholder interface
interface Plugin {
id: number;
name: string;
version: string;
isEnabled: boolean;
permissions: string[];
urls: string[];
}

export class PluginRepository {
Expand Down Expand Up @@ -78,6 +81,10 @@ export class PluginRepository {
return this.#blacklist;
}

public isBlacklisted(id: number): boolean {
return this.#blacklist.has(id);
}

public registry(): PluginRegistry {
return this.#registry;
}
Expand Down

0 comments on commit 138a5aa

Please sign in to comment.