var K=Object.defineProperty;var M=(w)=>w;function N(w,D){this[w]=M.bind(null,D)}var T=(w,D)=>{for(var H in D)K(w,H,{get:D[H],enumerable:!0,configurable:!0,set:N.bind(D,H)})};var U=(w,D)=>()=>(w&&(D=w(w=0)),D);import{contractFirstApiBrief as G}from"@contractspec/bundle.library/components/docs/intent/intent-pages.docblocks";import{SeoOptimizer as P}from"@contractspec/lib.content-gen/seo";import{CodeBlock as I}from"@contractspec/lib.design-system";import J from"@contractspec/lib.ui-link";import{ChevronRight as Q}from"lucide-react";import{jsx as q,jsxs as E}from"react/jsx-runtime";var $=new P().optimize(G);function v(){return E("div",{className:"space-y-8",children:[E("div",{className:"space-y-3",children:[q("h1",{className:"font-bold text-4xl",children:G.title}),q("p",{className:"text-lg text-muted-foreground",children:G.summary})]}),E("div",{className:"card-subtle space-y-4 p-6",children:[q("h2",{className:"font-bold text-2xl",children:"Problems Solved"}),q("ul",{className:"space-y-2 text-muted-foreground text-sm",children:G.problems.map((w,D)=>q("li",{children:w},D))})]}),E("div",{className:"card-subtle space-y-4 p-6",children:[q("h2",{className:"font-bold text-2xl",children:"Solutions"}),q("ul",{className:"space-y-2 text-muted-foreground text-sm",children:G.solutions.map((w,D)=>q("li",{children:w},D))})]}),E("div",{className:"space-y-6",children:[E("div",{className:"space-y-3",children:[q("h2",{className:"font-bold text-2xl",children:"Quick Start"}),q("p",{className:"text-muted-foreground text-sm",children:"Define your first API contract and generate consistent implementations."}),q(I,{language:"typescript",filename:"src/contracts/user-create.operation.ts",code:`import { defineOperation } from '@contractspec/lib.contracts-spec/operations';
import { SchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';

export const CreateUserOperation = defineOperation({
  goal: 'Create a new user account with validation',
  context: 'Used by frontend registration forms and internal admin tools',
  input: new SchemaModel({
    type: 'object',
    properties: {
      email: {
        type: 'string',
        format: 'email',
        required: true,
      },
      password: {
        type: 'string',
        minLength: 8,
        required: true,
      },
    },
  }),
  output: new SchemaModel({
    type: 'object',
    properties: {
      id: { type: 'string', required: true },
      email: { type: 'string', required: true },
      createdAt: { type: 'string', format: 'date-time', required: true },
    },
  }),
  metadata: {
    name: 'createUser',
    tags: ['users', 'auth'],
    description: 'Create a new user account with email and password',
  },
});`})]}),E("div",{className:"space-y-3",children:[q("h2",{className:"font-bold text-2xl",children:"Generate OpenAPI"}),q("p",{className:"text-muted-foreground text-sm",children:"Export OpenAPI documentation directly from your contracts."}),q(I,{language:"bash",filename:"export-openapi",code:"contractspec openapi export \\\n  --registry ./src/contracts/registry.ts \\\n  --out ./openapi.json"})]})]}),E("div",{className:"flex items-center gap-4 pt-4",children:[E(J,{href:"/docs/guides/nextjs-one-endpoint",className:"btn-primary",children:["Next.js Guide ",q(Q,{size:16})]}),q(J,{href:"/docs/intent/spec-driven-development",className:"btn-ghost",children:"Spec-driven Development"})]})]})}export{$ as metadata,v as ContractFirstApiPage};
