Interface DatabaseInterface

interface DatabaseInterface {
    close(): Promise<void>;
    deleteAllRulesets(): Promise<void>;
    deleteRuleset(id: string): Promise<void>;
    getRuleset(id: string): Promise<undefined | Ruleset>;
    listRulesets(): Promise<Ruleset[]>;
    saveRuleset(id: string, data: Ruleset): Promise<void>;
}

Methods

  • Saves a ruleset with the given ID. If it already exists it will be updated, otherwise it will be created.

    Parameters

    • id: string

      The ID of the ruleset

    • data: Ruleset

      The actual ruleset

    Returns Promise<void>