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 / @UseMembers (5)
get
get(pkg: string): PluginModuleRequestRow | nullThe row for one package; null when nobody ever asked.
@parampkg
string@returns
PluginModuleRequestRow | nulllist
list(): PluginModuleRequestRow[]Every row, pending ones first, then the most recently asked or decided.
@returns
PluginModuleRequestRow[]upsert
upsert(row: PluginModuleRequestRow): voidWrites the whole row, replacing any row for the same package.
@paramrow
PluginModuleRequestRow@returns
voiddecide
decide(pkg: string, decision: "enabled" | "declined", by: string, at: string, via: PluginModuleVia | null): booleanRecords an administrator's decision on an existing row; false when there is none.
@parampkg
string@paramdecision
"enabled" | "declined"@paramby
string@paramat
string@paramvia
PluginModuleVia | null@returns
booleanpendingCount
pendingCount(): numberHow many rows wait for a decision.
@returns
number