feat: define housekeeping foundation contracts
This commit is contained in:
1 parent
3b3d7780c9
commit
7d62a04f0e
10 files changed
+338
No files matched your search
@@ -0,0 +1,36 @@
|
||||
import type { HousekeepingDomainId } from "../../migration/types";
|
||||
import type {
|
||||
CapabilityRequirement,
|
||||
HousekeepingCapabilityContext,
|
||||
} from "./capability";
|
||||
import type { HousekeepingResult } from "./result";
|
||||
|
||||
export type HousekeepingWorkItemSeverity = "info" | "warning" | "critical";
|
||||
export type HousekeepingWorkItemFreshness = "fresh" | "stale";
|
||||
export type HousekeepingInboxSourceAvailability = "available" | "unavailable";
|
||||
|
||||
export interface HousekeepingWorkItem {
|
||||
sourceId: string;
|
||||
itemId: string;
|
||||
deduplicationKey: string;
|
||||
domain: HousekeepingDomainId;
|
||||
capability: CapabilityRequirement;
|
||||
severity: HousekeepingWorkItemSeverity;
|
||||
occurredAt: string;
|
||||
titleKey: string;
|
||||
context?: Readonly<Record<string, unknown>>;
|
||||
href: string;
|
||||
freshness: HousekeepingWorkItemFreshness;
|
||||
}
|
||||
|
||||
export interface HousekeepingInboxSourceResult {
|
||||
items: readonly HousekeepingWorkItem[];
|
||||
availability: HousekeepingInboxSourceAvailability;
|
||||
}
|
||||
|
||||
export interface HousekeepingInboxSource {
|
||||
getItems(
|
||||
context: HousekeepingCapabilityContext,
|
||||
signal: AbortSignal,
|
||||
): Promise<HousekeepingResult<HousekeepingInboxSourceResult>>;
|
||||
}
|
||||
Reference in new issue
Block a user