import type { Meta, StoryObj } from "@storybook/react"; import { PIPELINE_OPS, LIBRARY_OPS, OP_CATEGORIES, PIPELINE_AGENTS, SOURCE_OPTIONS, DESTINATION_OPTIONS, type OpKind, } from "@shared/data/ops"; const meta: Meta = { title: "Data/Ops library", parameters: { layout: "padded" }, }; export default meta; type Story = StoryObj; const STAGE_ORDER: OpKind[] = [ "ingest", "validate", "modify", "secure", "store", "alert", ]; const STAGE_COLOUR: Record = { ingest: "var(--color-green)", validate: "var(--color-blue)", modify: "#F97316", secure: "var(--color-red)", store: "var(--color-purple)", alert: "var(--color-amber)", }; export const PipelineOps: Story = { render: () => (
{STAGE_ORDER.map((stage) => (

{stage}

{PIPELINE_OPS[stage].length} ops
{PIPELINE_OPS[stage].map((op) => ( {op.label} {op.defaultOn && ( · default )} ))}
))}
), }; export const LibraryByCategory: Story = { render: () => (
{LIBRARY_OPS.length} library ops across {OP_CATEGORIES.length}{" "} categories
{OP_CATEGORIES.map((cat) => { const ops = LIBRARY_OPS.filter((op) => op.category === cat.name); return (

{cat.name}

{cat.blurb} {ops.length}
{ops.map((op) => ( {op.label} {op.provider && ( · {op.provider} )} ))}
); })}
), }; export const Agents: Story = { render: () => (
{PIPELINE_AGENTS.map((a) => (
{a.label}
{a.desc}
{a.ops.map((op) => ( {op} ))}
))}
), }; export const SourcesAndDestinations: Story = { render: () => (

Sources

{SOURCE_OPTIONS.map((s) => (
{s.label}
{s.desc}
))}

Destinations

{DESTINATION_OPTIONS.map((d) => (
{d.label}
{d.desc}
))}
), };