refactor(housekeeping): stabilize service contracts

This commit is contained in:
Simo committed 2026-08-26 21:04:42 +02:00
1 parent 67cb4b488d
commit b7edbca043
10 files changed
+145 -28

No files matched your search

@@ -8,6 +8,7 @@ import {
} from "../migration/types";
import {
anyCapability,
type CanonicalHousekeepingHref,
type CapabilityRequirement,
type HousekeepingDomainManifest,
type HousekeepingInboxSource,
@@ -232,7 +233,7 @@ describe("housekeeping registry", () => {
{
id: "users",
labelKey: "pages.housekeeping.domains.people.title",
href: "/ase/people/users" as `/ase${string}`,
href: "/ase/people/users" as CanonicalHousekeepingHref,
capability: anyCapability(PERMS.USERS_VIEW),
},
{
@@ -253,13 +254,13 @@ describe("housekeeping registry", () => {
{
id: "users",
labelKey: "pages.housekeeping.domains.people.title",
href: "/ase/people/users" as `/ase${string}`,
href: "/ase/people/users" as CanonicalHousekeepingHref,
capability: anyCapability(PERMS.USERS_VIEW),
},
{
id: "staff",
labelKey: "pages.housekeeping.domains.people.title",
href: "/ase/people/users" as `/ase${string}`,
href: "/ase/people/users" as CanonicalHousekeepingHref,
capability: anyCapability(PERMS.USERS_VIEW),
},
],
@@ -272,7 +273,7 @@ describe("housekeeping registry", () => {
const route = {
id: "users",
labelKey: "pages.housekeeping.domains.people.title",
href: "/ase/people/users" as `/ase${string}`,
href: "/ase/people/users" as CanonicalHousekeepingHref,
capability: anyCapability(PERMS.USERS_VIEW),
};
@@ -285,7 +286,7 @@ describe("housekeeping registry", () => {
createHousekeepingRegistry([
{
...manifest("people"),
routes: [{ ...route, href: " " as `/ase${string}` }],
routes: [{ ...route, href: " " as CanonicalHousekeepingHref }],
},
]),
).toThrow("empty route href");
@@ -484,7 +485,7 @@ describe("housekeeping registry", () => {
{
id: "users",
labelKey: "pages.housekeeping.domains.people.title",
href: "/ase/people/users" as `/ase${string}`,
href: "/ase/people/users" as CanonicalHousekeepingHref,
capability: { mode: "any", slugs: [] },
},
],
@@ -497,7 +498,7 @@ describe("housekeeping registry", () => {
const route = {
id: "shared",
labelKey: "pages.housekeeping.domains.people.title",
href: "/ase/shared" as `/ase${string}`,
href: "/ase/shared" as CanonicalHousekeepingHref,
capability: anyCapability(PERMS.USERS_VIEW),
};
@@ -507,7 +508,10 @@ describe("housekeeping registry", () => {
{
...manifest("content"),
routes: [
{ ...route, href: "/ase/content/shared" as `/ase${string}` },
{
...route,
href: "/ase/content/shared" as CanonicalHousekeepingHref,
},
],
},
]),