@prismshadow/penguin-library-setting · library/setting/src/plugin-module-requests.ts:34

PluginModuleRequests

interface

PluginModuleRequests: the mechanism PluginModuleRequestsRepo implements.

API

@Interface()
export abstract class PluginModuleRequests {
  abstract get(pkg: string): PluginModuleRequestRow | null;
  abstract list(): PluginModuleRequestRow[];
  abstract upsert(row: PluginModuleRequestRow): void;
  abstract decide(
      pkg: string,
      decision: "enabled" | "declined",
      by: string,
      at: string,
      via: PluginModuleVia | null,
    ): boolean;
  abstract pendingCount(): number;
}

Contract Topology

Static AST wiring across @Module / @Provide / @Use
@Provideprovided by
@Useconsumed by (1)

Members (5)

get

get(pkg: string): PluginModuleRequestRow | null

The row for one package; null when nobody ever asked.

@parampkgstring
@returnsPluginModuleRequestRow | null

list

list(): PluginModuleRequestRow[]

Every row, pending ones first, then the most recently asked or decided.

@returnsPluginModuleRequestRow[]

upsert

upsert(row: PluginModuleRequestRow): void

Writes the whole row, replacing any row for the same package.

@paramrowPluginModuleRequestRow
@returnsvoid

decide

decide(pkg: string, decision: "enabled" | "declined", by: string, at: string, via: PluginModuleVia | null): boolean

Records an administrator's decision on an existing row; false when there is none.

@parampkgstring
@paramdecision"enabled" | "declined"
@parambystring
@paramatstring
@paramviaPluginModuleVia | null
@returnsboolean

pendingCount

pendingCount(): number

How many rows wait for a decision.

@returnsnumber