Files
cfw-autumn/apps/sdk-test/lib/scenarios.ts
John Yeo 90287e6308 latest
2026-02-19 13:24:33 +00:00

98 lines
2.3 KiB
TypeScript

export type ScenarioStatus = "ready" | "wip" | "planned";
export type ScenarioItem = {
id: string;
title: string;
href: string;
description: string;
status: ScenarioStatus;
};
export type ScenarioSection = {
id: string;
title: string;
items: Array<ScenarioItem>;
};
export const scenarioSections: Array<ScenarioSection> = [
{
id: "core",
title: "Core",
items: [
{
id: "use-customer",
title: "useCustomer",
href: "/scenarios/core/use-customer",
description: "Inspect customer fetch state and payloads.",
status: "ready",
},
{
id: "use-list-plans",
title: "useListPlans",
href: "/scenarios/core/use-list-plans",
description: "Inspect plans list and payloads.",
status: "ready",
},
{
id: "use-autumn",
title: "useAutumn",
href: "/scenarios/core/use-autumn",
description: "Test attach/check action helpers and inspect payloads.",
status: "ready",
},
{
id: "use-referrals",
title: "useReferrals",
href: "/scenarios/core/use-referrals",
description: "Test create/redeem referral code action helpers.",
status: "ready",
},
{
id: "use-entity",
title: "useEntity",
href: "/scenarios/core/use-entity",
description: "Inspect entity-level behavior.",
status: "planned",
},
],
},
{
id: "better-auth",
title: "Better Auth",
items: [
{
id: "better-auth-use-customer",
title: "useCustomer",
href: "/scenarios/better-auth/use-customer",
description: "Validate better-auth plugin routing.",
status: "ready",
},
],
},
{
id: "convex",
title: "Convex",
items: [
{
id: "convex-use-customer",
title: "useCustomer",
href: "/scenarios/convex/use-customer",
description: "Validate convex provider integration.",
status: "planned",
},
],
},
];
export const findScenarioByHref = ({ href }: { href: string }) => {
for (const section of scenarioSections) {
for (const item of section.items) {
if (item.href === href) {
return { section, item };
}
}
}
return null;
};