business-as-code 0.0.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +209 -379
- package/dist/index.d.ts +4 -146
- package/dist/index.js +1051 -143
- package/dist/index.js.map +1 -0
- package/dist/loaders/index.d.ts +174 -0
- package/dist/loaders/index.js +366 -0
- package/dist/loaders/index.js.map +1 -0
- package/dist/schema/index.d.ts +146 -0
- package/dist/schema/index.js +716 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/types-CJ9eGS_C.d.ts +86 -0
- package/package.json +55 -36
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/schema/domains/admin.ts","../src/schema/domains/business.ts","../src/schema/domains/product.ts","../src/schema/domains/success.ts","../src/schema/domains/sales.ts","../src/schema/domains/marketing.ts","../src/schema/domains/work.ts","../src/schema/domains/financial.ts","../src/schema/domains/communications.ts","../src/schema/index.ts","../src/loaders/mdx.ts","../src/loaders/yaml.ts","../src/loaders/json.ts","../src/loaders/index.ts"],"sourcesContent":["/**\n * Admin Domain - Core system entities\n */\n\nimport type { NounSchema } from '../../types'\n\nexport const Users: NounSchema = {\n slug: 'users',\n group: 'Admin',\n titleField: 'email',\n fields: [\n { name: 'email', type: 'email', required: true, unique: true },\n { name: 'name', type: 'text' },\n { name: 'avatar', type: 'image' },\n { name: 'role', type: 'status', options: ['admin', 'user', 'viewer'] },\n ],\n}\n\nexport const Orgs: NounSchema = {\n slug: 'orgs',\n group: 'Admin',\n titleField: 'name',\n fields: [\n { name: 'name', type: 'text', required: true },\n { name: 'slug', type: 'text', required: true, unique: true },\n { name: 'logo', type: 'image' },\n { name: 'domain', type: 'text' },\n ],\n}\n\nexport const ServiceAccounts: NounSchema = {\n slug: 'service-accounts',\n group: 'Admin',\n titleField: 'name',\n fields: [\n { name: 'name', type: 'text', required: true },\n { name: 'org', type: 'ref', config: { relationTo: 'orgs' } },\n { name: 'apiKey', type: 'text', unique: true },\n { name: 'scopes', type: 'array' },\n ],\n}\n\nexport const adminNouns: NounSchema[] = [Users, Orgs, ServiceAccounts]\n","/**\n * Business Domain - Core business entities\n */\n\nimport type { NounSchema } from '../../types'\n\nexport const Businesses: NounSchema = {\n slug: 'businesses',\n group: 'Business',\n titleField: 'name',\n fields: [\n { name: 'name', type: 'text', required: true },\n { name: 'legalName', type: 'text' },\n { name: 'type', type: 'status', options: ['LLC', 'Corporation', 'Partnership', 'Sole Proprietorship', 'Nonprofit'] },\n { name: 'status', type: 'status', options: ['Active', 'Inactive', 'Dissolved'] },\n { name: 'foundedDate', type: 'date' },\n { name: 'website', type: 'url' },\n { name: 'description', type: 'rich' },\n ],\n}\n\nexport const Goals: NounSchema = {\n slug: 'goals',\n group: 'Business',\n titleField: 'name',\n fields: [\n { name: 'name', type: 'text', required: true },\n { name: 'business', type: 'ref', config: { relationTo: 'businesses' } },\n { name: 'type', type: 'status', options: ['Revenue', 'Growth', 'Retention', 'Efficiency', 'Quality'] },\n { name: 'targetValue', type: 'number' },\n { name: 'currentValue', type: 'number' },\n { name: 'unit', type: 'text' },\n { name: 'deadline', type: 'date' },\n { name: 'status', type: 'status', options: ['Not Started', 'In Progress', 'At Risk', 'Achieved'] },\n ],\n}\n\nexport const Metrics: NounSchema = {\n slug: 'metrics',\n group: 'Business',\n titleField: 'name',\n fields: [\n { name: 'name', type: 'text', required: true },\n { name: 'business', type: 'ref', config: { relationTo: 'businesses' } },\n { name: 'type', type: 'status', options: ['KPI', 'OKR', 'North Star', 'Health', 'Vanity'] },\n { name: 'value', type: 'number' },\n { name: 'unit', type: 'text' },\n { name: 'frequency', type: 'status', options: ['Real-time', 'Daily', 'Weekly', 'Monthly', 'Quarterly'] },\n ],\n}\n\nexport const Teams: NounSchema = {\n slug: 'teams',\n group: 'Business',\n titleField: 'name',\n fields: [\n { name: 'name', type: 'text', required: true },\n { name: 'business', type: 'ref', config: { relationTo: 'businesses' } },\n { name: 'type', type: 'status', options: ['Engineering', 'Product', 'Design', 'Marketing', 'Sales', 'Support', 'Operations', 'Finance', 'HR', 'Legal'] },\n { name: 'description', type: 'text' },\n ],\n}\n\nexport const Processes: NounSchema = {\n slug: 'processes',\n group: 'Business',\n titleField: 'name',\n fields: [\n { name: 'name', type: 'text', required: true },\n { name: 'business', type: 'ref', config: { relationTo: 'businesses' } },\n { name: 'type', type: 'status', options: ['Core', 'Support', 'Management'] },\n { name: 'owner', type: 'ref', config: { relationTo: 'teams' } },\n { name: 'description', type: 'rich' },\n { name: 'status', type: 'status', options: ['Draft', 'Active', 'Deprecated'] },\n ],\n}\n\nexport const businessNouns: NounSchema[] = [Businesses, Goals, Metrics, Teams, Processes]\n","/**\n * Product Domain - Products, services, and offerings\n */\n\nimport type { NounSchema } from '../../types'\n\nexport const Products: NounSchema = {\n slug: 'products',\n group: 'Product',\n titleField: 'name',\n fields: [\n { name: 'name', type: 'text', required: true },\n { name: 'business', type: 'ref', config: { relationTo: 'businesses' } },\n { name: 'type', type: 'status', options: ['API', 'App', 'CLI', 'SDK', 'MCP', 'Agent', 'Dataset', 'DataFeed', 'Function', 'Database', 'Queue', 'Storage', 'Cache', 'Platform'] },\n { name: 'description', type: 'text' },\n { name: 'isActive', type: 'boolean' },\n { name: 'stripeProductId', type: 'text', unique: true },\n ],\n}\n\nexport const Services: NounSchema = {\n slug: 'services',\n group: 'Product',\n titleField: 'name',\n fields: [\n { name: 'name', type: 'text', required: true },\n { name: 'business', type: 'ref', config: { relationTo: 'businesses' } },\n { name: 'type', type: 'status', options: ['Consulting', 'Implementation', 'Training', 'Support', 'Managed'] },\n { name: 'description', type: 'text' },\n { name: 'hourlyRate', type: 'money' },\n { name: 'isActive', type: 'boolean' },\n ],\n}\n\nexport const Offers: NounSchema = {\n slug: 'offers',\n group: 'Product',\n titleField: 'name',\n fields: [\n { name: 'name', type: 'text', required: true },\n { name: 'products', type: 'ref', config: { relationTo: 'products', hasMany: true } },\n { name: 'type', type: 'status', options: ['Trial', 'Freemium', 'Subscription', 'One-time', 'Usage-based'] },\n { name: 'description', type: 'text' },\n { name: 'isActive', type: 'boolean' },\n ],\n}\n\nexport const Prices: NounSchema = {\n slug: 'prices',\n group: 'Product',\n titleField: 'name',\n fields: [\n { name: 'name', type: 'text', required: true },\n { name: 'offer', type: 'ref', config: { relationTo: 'offers' } },\n { name: 'amount', type: 'money', required: true },\n { name: 'currency', type: 'status', options: ['USD', 'EUR', 'GBP', 'JPY'] },\n { name: 'interval', type: 'status', options: ['once', 'day', 'week', 'month', 'year'] },\n { name: 'stripePriceId', type: 'text', unique: true },\n { name: 'isActive', type: 'boolean' },\n ],\n}\n\nexport const Features: NounSchema = {\n slug: 'features',\n group: 'Product',\n titleField: 'name',\n fields: [\n { name: 'name', type: 'text', required: true },\n { name: 'product', type: 'ref', config: { relationTo: 'products' } },\n { name: 'description', type: 'text' },\n { name: 'type', type: 'status', options: ['Core', 'Premium', 'Enterprise', 'Add-on'] },\n { name: 'status', type: 'status', options: ['Planned', 'In Development', 'Beta', 'GA', 'Deprecated'] },\n ],\n}\n\nexport const productNouns: NounSchema[] = [Products, Services, Offers, Prices, Features]\n","/**\n * Success Domain - Customer success and relationships\n */\n\nimport type { NounSchema } from '../../types'\n\nexport const Customers: NounSchema = {\n slug: 'customers',\n group: 'Success',\n titleField: 'name',\n fields: [\n { name: 'name', type: 'text', required: true },\n { name: 'type', type: 'status', options: ['Business', 'Developer', 'Consumer', 'Professional'], required: true },\n { name: 'user', type: 'ref', config: { relationTo: 'users' } },\n { name: 'business', type: 'ref', config: { relationTo: 'businesses' } },\n { name: 'company', type: 'text' },\n { name: 'email', type: 'email' },\n { name: 'stripeCustomerId', type: 'text', unique: true },\n { name: 'status', type: 'status', options: ['Active', 'Churned', 'Paused'] },\n { name: 'healthScore', type: 'score' },\n ],\n}\n\nexport const Contacts: NounSchema = {\n slug: 'contacts',\n group: 'Success',\n titleField: 'name',\n fields: [\n { name: 'name', type: 'text', required: true },\n { name: 'customer', type: 'ref', config: { relationTo: 'customers' } },\n { name: 'email', type: 'email' },\n { name: 'phone', type: 'text' },\n { name: 'title', type: 'text' },\n { name: 'role', type: 'status', options: ['Decision Maker', 'Influencer', 'Champion', 'End User', 'Billing'] },\n { name: 'isPrimary', type: 'boolean' },\n ],\n}\n\nexport const Subscriptions: NounSchema = {\n slug: 'subscriptions',\n group: 'Success',\n titleField: 'id',\n fields: [\n { name: 'customer', type: 'ref', config: { relationTo: 'customers' }, required: true },\n { name: 'offer', type: 'ref', config: { relationTo: 'offers' } },\n { name: 'price', type: 'ref', config: { relationTo: 'prices' } },\n { name: 'status', type: 'status', options: ['Active', 'Past Due', 'Canceled', 'Paused', 'Trialing'] },\n { name: 'stripeSubscriptionId', type: 'text', unique: true },\n { name: 'currentPeriodStart', type: 'date' },\n { name: 'currentPeriodEnd', type: 'date' },\n { name: 'canceledAt', type: 'date' },\n ],\n}\n\nexport const successNouns: NounSchema[] = [Customers, Contacts, Subscriptions]\n","/**\n * Sales Domain - Sales pipeline and deals\n */\n\nimport type { NounSchema } from '../../types'\n\nexport const Deals: NounSchema = {\n slug: 'deals',\n group: 'Sales',\n titleField: 'name',\n fields: [\n { name: 'name', type: 'text', required: true },\n { name: 'customer', type: 'ref', config: { relationTo: 'customers' } },\n { name: 'contact', type: 'ref', config: { relationTo: 'contacts' } },\n { name: 'value', type: 'money' },\n { name: 'stage', type: 'status', options: ['Qualification', 'Discovery', 'Proposal', 'Negotiation', 'Closed Won', 'Closed Lost'] },\n { name: 'probability', type: 'score' },\n { name: 'expectedCloseDate', type: 'date' },\n { name: 'actualCloseDate', type: 'date' },\n { name: 'lostReason', type: 'text' },\n ],\n}\n\nexport const Quotes: NounSchema = {\n slug: 'quotes',\n group: 'Sales',\n titleField: 'name',\n fields: [\n { name: 'name', type: 'text', required: true },\n { name: 'deal', type: 'ref', config: { relationTo: 'deals' } },\n { name: 'customer', type: 'ref', config: { relationTo: 'customers' } },\n { name: 'total', type: 'money', required: true },\n { name: 'status', type: 'status', options: ['Draft', 'Sent', 'Viewed', 'Accepted', 'Rejected', 'Expired'] },\n { name: 'validUntil', type: 'date' },\n { name: 'terms', type: 'rich' },\n ],\n}\n\nexport const Proposals: NounSchema = {\n slug: 'proposals',\n group: 'Sales',\n titleField: 'name',\n fields: [\n { name: 'name', type: 'text', required: true },\n { name: 'deal', type: 'ref', config: { relationTo: 'deals' } },\n { name: 'customer', type: 'ref', config: { relationTo: 'customers' } },\n { name: 'content', type: 'rich' },\n { name: 'status', type: 'status', options: ['Draft', 'In Review', 'Sent', 'Accepted', 'Rejected'] },\n { name: 'sentAt', type: 'date' },\n ],\n}\n\nexport const salesNouns: NounSchema[] = [Deals, Quotes, Proposals]\n","/**\n * Marketing Domain - Leads, brands, and marketing assets\n */\n\nimport type { NounSchema } from '../../types'\n\nexport const Leads: NounSchema = {\n slug: 'leads',\n group: 'Marketing',\n titleField: 'email',\n fields: [\n { name: 'email', type: 'email', required: true },\n { name: 'name', type: 'text' },\n { name: 'company', type: 'text' },\n { name: 'title', type: 'text' },\n { name: 'source', type: 'status', options: ['Website', 'Referral', 'Event', 'Ads', 'Content', 'Outbound', 'Partner'] },\n { name: 'status', type: 'status', options: ['New', 'Contacted', 'Qualified', 'Unqualified', 'Converted'] },\n { name: 'score', type: 'score' },\n { name: 'convertedTo', type: 'ref', config: { relationTo: 'customers' } },\n ],\n}\n\nexport const Brands: NounSchema = {\n slug: 'brands',\n group: 'Marketing',\n titleField: 'name',\n fields: [\n { name: 'name', type: 'text', required: true },\n { name: 'business', type: 'ref', config: { relationTo: 'businesses' } },\n { name: 'tagline', type: 'text' },\n { name: 'description', type: 'rich' },\n { name: 'logo', type: 'image' },\n { name: 'primaryColor', type: 'text' },\n { name: 'secondaryColor', type: 'text' },\n ],\n}\n\nexport const Domains: NounSchema = {\n slug: 'domains',\n group: 'Marketing',\n titleField: 'domain',\n fields: [\n { name: 'domain', type: 'text', required: true, unique: true },\n { name: 'business', type: 'ref', config: { relationTo: 'businesses' } },\n { name: 'brand', type: 'ref', config: { relationTo: 'brands' } },\n { name: 'type', type: 'status', options: ['Primary', 'Redirect', 'Vanity', 'Product'] },\n { name: 'status', type: 'status', options: ['Active', 'Pending', 'Expired'] },\n { name: 'registrar', type: 'text' },\n { name: 'expiresAt', type: 'date' },\n ],\n}\n\nexport const Competitors: NounSchema = {\n slug: 'competitors',\n group: 'Marketing',\n titleField: 'name',\n fields: [\n { name: 'name', type: 'text', required: true },\n { name: 'business', type: 'ref', config: { relationTo: 'businesses' } },\n { name: 'website', type: 'url' },\n { name: 'description', type: 'text' },\n { name: 'strengths', type: 'rich' },\n { name: 'weaknesses', type: 'rich' },\n { name: 'threat', type: 'status', options: ['Low', 'Medium', 'High', 'Critical'] },\n ],\n}\n\nexport const marketingNouns: NounSchema[] = [Leads, Brands, Domains, Competitors]\n","/**\n * Work Domain - Projects, tasks, and workflows\n */\n\nimport type { NounSchema } from '../../types'\n\nexport const Projects: NounSchema = {\n slug: 'projects',\n group: 'Work',\n titleField: 'name',\n fields: [\n { name: 'name', type: 'text', required: true },\n { name: 'business', type: 'ref', config: { relationTo: 'businesses' } },\n { name: 'team', type: 'ref', config: { relationTo: 'teams' } },\n { name: 'description', type: 'rich' },\n { name: 'status', type: 'status', options: ['Planning', 'Active', 'On Hold', 'Completed', 'Archived'] },\n { name: 'startDate', type: 'date' },\n { name: 'targetDate', type: 'date' },\n { name: 'completedDate', type: 'date' },\n ],\n}\n\nexport const Tasks: NounSchema = {\n slug: 'tasks',\n group: 'Work',\n titleField: 'title',\n fields: [\n { name: 'title', type: 'text', required: true },\n { name: 'project', type: 'ref', config: { relationTo: 'projects' } },\n { name: 'assignee', type: 'ref', config: { relationTo: 'users' } },\n { name: 'description', type: 'rich' },\n { name: 'status', type: 'status', options: ['Backlog', 'Todo', 'In Progress', 'In Review', 'Done'] },\n { name: 'priority', type: 'status', options: ['Low', 'Medium', 'High', 'Urgent'] },\n { name: 'dueDate', type: 'date' },\n { name: 'estimatedHours', type: 'number' },\n { name: 'actualHours', type: 'number' },\n ],\n}\n\nexport const Issues: NounSchema = {\n slug: 'issues',\n group: 'Work',\n titleField: 'title',\n fields: [\n { name: 'title', type: 'text', required: true },\n { name: 'project', type: 'ref', config: { relationTo: 'projects' } },\n { name: 'reporter', type: 'ref', config: { relationTo: 'users' } },\n { name: 'assignee', type: 'ref', config: { relationTo: 'users' } },\n { name: 'description', type: 'rich' },\n { name: 'type', type: 'status', options: ['Bug', 'Feature', 'Task', 'Epic', 'Story'] },\n { name: 'status', type: 'status', options: ['Open', 'In Progress', 'Resolved', 'Closed'] },\n { name: 'priority', type: 'status', options: ['Low', 'Medium', 'High', 'Critical'] },\n ],\n}\n\nexport const Workflows: NounSchema = {\n slug: 'workflows',\n group: 'Work',\n titleField: 'name',\n fields: [\n { name: 'name', type: 'text', required: true },\n { name: 'business', type: 'ref', config: { relationTo: 'businesses' } },\n { name: 'description', type: 'text' },\n { name: 'trigger', type: 'status', options: ['Manual', 'Schedule', 'Event', 'Webhook'] },\n { name: 'status', type: 'status', options: ['Draft', 'Active', 'Paused', 'Archived'] },\n ],\n}\n\nexport const Roles: NounSchema = {\n slug: 'roles',\n group: 'Work',\n titleField: 'name',\n fields: [\n { name: 'name', type: 'text', required: true },\n { name: 'business', type: 'ref', config: { relationTo: 'businesses' } },\n { name: 'team', type: 'ref', config: { relationTo: 'teams' } },\n { name: 'description', type: 'text' },\n { name: 'level', type: 'status', options: ['Individual Contributor', 'Lead', 'Manager', 'Director', 'VP', 'C-Level'] },\n ],\n}\n\nexport const Agents: NounSchema = {\n slug: 'agents',\n group: 'Work',\n titleField: 'name',\n fields: [\n { name: 'name', type: 'text', required: true },\n { name: 'business', type: 'ref', config: { relationTo: 'businesses' } },\n { name: 'role', type: 'ref', config: { relationTo: 'roles' } },\n { name: 'type', type: 'status', options: ['AI', 'Human', 'Hybrid'] },\n { name: 'status', type: 'status', options: ['Active', 'Paused', 'Retired'] },\n { name: 'capabilities', type: 'array' },\n ],\n}\n\nexport const workNouns: NounSchema[] = [Projects, Tasks, Issues, Workflows, Roles, Agents]\n","/**\n * Financial Domain - Accounting, invoicing, and payments\n */\n\nimport type { NounSchema } from '../../types'\n\nexport const Invoices: NounSchema = {\n slug: 'invoices',\n group: 'Financial',\n titleField: 'number',\n fields: [\n { name: 'number', type: 'text', required: true, unique: true },\n { name: 'customer', type: 'ref', config: { relationTo: 'customers' } },\n { name: 'subscription', type: 'ref', config: { relationTo: 'subscriptions' } },\n { name: 'total', type: 'money', required: true },\n { name: 'tax', type: 'money' },\n { name: 'status', type: 'status', options: ['Draft', 'Sent', 'Paid', 'Void', 'Uncollectible'] },\n { name: 'dueDate', type: 'date' },\n { name: 'paidAt', type: 'date' },\n { name: 'stripeInvoiceId', type: 'text', unique: true },\n ],\n}\n\nexport const Payments: NounSchema = {\n slug: 'payments',\n group: 'Financial',\n titleField: 'id',\n fields: [\n { name: 'customer', type: 'ref', config: { relationTo: 'customers' } },\n { name: 'invoice', type: 'ref', config: { relationTo: 'invoices' } },\n { name: 'amount', type: 'money', required: true },\n { name: 'currency', type: 'status', options: ['USD', 'EUR', 'GBP', 'JPY'] },\n { name: 'status', type: 'status', options: ['Pending', 'Succeeded', 'Failed', 'Refunded'] },\n { name: 'method', type: 'status', options: ['Card', 'ACH', 'Wire', 'Check'] },\n { name: 'stripePaymentId', type: 'text', unique: true },\n ],\n}\n\nexport const Refunds: NounSchema = {\n slug: 'refunds',\n group: 'Financial',\n titleField: 'id',\n fields: [\n { name: 'payment', type: 'ref', config: { relationTo: 'payments' }, required: true },\n { name: 'amount', type: 'money', required: true },\n { name: 'reason', type: 'status', options: ['Duplicate', 'Fraudulent', 'Customer Request', 'Product Issue'] },\n { name: 'status', type: 'status', options: ['Pending', 'Succeeded', 'Failed'] },\n { name: 'notes', type: 'text' },\n ],\n}\n\nexport const ChartOfAccounts: NounSchema = {\n slug: 'chart-of-accounts',\n group: 'Financial',\n titleField: 'name',\n fields: [\n { name: 'code', type: 'text', required: true, unique: true },\n { name: 'name', type: 'text', required: true },\n { name: 'type', type: 'status', options: ['Asset', 'Liability', 'Equity', 'Revenue', 'Expense'], required: true },\n { name: 'subtype', type: 'text' },\n { name: 'description', type: 'text' },\n { name: 'isActive', type: 'boolean' },\n ],\n}\n\nexport const JournalEntries: NounSchema = {\n slug: 'journal-entries',\n group: 'Financial',\n titleField: 'reference',\n fields: [\n { name: 'reference', type: 'text', required: true },\n { name: 'date', type: 'date', required: true },\n { name: 'description', type: 'text' },\n { name: 'debitAccount', type: 'ref', config: { relationTo: 'chart-of-accounts' } },\n { name: 'creditAccount', type: 'ref', config: { relationTo: 'chart-of-accounts' } },\n { name: 'amount', type: 'money', required: true },\n { name: 'status', type: 'status', options: ['Draft', 'Posted', 'Voided'] },\n ],\n}\n\nexport const financialNouns: NounSchema[] = [Invoices, Payments, Refunds, ChartOfAccounts, JournalEntries]\n","/**\n * Communications Domain - Messaging, sequences, and engagement\n */\n\nimport type { NounSchema } from '../../types'\n\nexport const Channels: NounSchema = {\n slug: 'channels',\n group: 'Communications',\n titleField: 'name',\n fields: [\n { name: 'name', type: 'text', required: true },\n { name: 'type', type: 'status', options: ['Email', 'SMS', 'Slack', 'Discord', 'WhatsApp', 'In-App', 'Push'] },\n { name: 'business', type: 'ref', config: { relationTo: 'businesses' } },\n { name: 'isActive', type: 'boolean' },\n { name: 'config', type: 'text' },\n ],\n}\n\nexport const Messages: NounSchema = {\n slug: 'messages',\n group: 'Communications',\n titleField: 'subject',\n fields: [\n { name: 'subject', type: 'text' },\n { name: 'body', type: 'rich', required: true },\n { name: 'channel', type: 'ref', config: { relationTo: 'channels' } },\n { name: 'from', type: 'text' },\n { name: 'to', type: 'text', required: true },\n { name: 'status', type: 'status', options: ['Draft', 'Queued', 'Sent', 'Delivered', 'Bounced', 'Failed'] },\n { name: 'sentAt', type: 'date' },\n { name: 'openedAt', type: 'date' },\n { name: 'clickedAt', type: 'date' },\n ],\n}\n\nexport const Sequences: NounSchema = {\n slug: 'sequences',\n group: 'Communications',\n titleField: 'name',\n fields: [\n { name: 'name', type: 'text', required: true },\n { name: 'business', type: 'ref', config: { relationTo: 'businesses' } },\n { name: 'type', type: 'status', options: ['Onboarding', 'Nurture', 'Re-engagement', 'Upsell', 'Support'] },\n { name: 'status', type: 'status', options: ['Draft', 'Active', 'Paused', 'Archived'] },\n { name: 'description', type: 'text' },\n ],\n}\n\nexport const Templates: NounSchema = {\n slug: 'templates',\n group: 'Communications',\n titleField: 'name',\n fields: [\n { name: 'name', type: 'text', required: true },\n { name: 'channel', type: 'ref', config: { relationTo: 'channels' } },\n { name: 'subject', type: 'text' },\n { name: 'body', type: 'rich', required: true },\n { name: 'type', type: 'status', options: ['Transactional', 'Marketing', 'System'] },\n { name: 'isActive', type: 'boolean' },\n ],\n}\n\nexport const Posts: NounSchema = {\n slug: 'posts',\n group: 'Communications',\n titleField: 'title',\n fields: [\n { name: 'title', type: 'text', required: true },\n { name: 'content', type: 'rich', required: true },\n { name: 'author', type: 'ref', config: { relationTo: 'users' } },\n { name: 'business', type: 'ref', config: { relationTo: 'businesses' } },\n { name: 'status', type: 'status', options: ['Draft', 'Scheduled', 'Published', 'Archived'] },\n { name: 'publishedAt', type: 'date' },\n { name: 'channels', type: 'ref', config: { relationTo: 'channels', hasMany: true } },\n ],\n}\n\nexport const communicationsNouns: NounSchema[] = [Channels, Messages, Sequences, Templates, Posts]\n","/**\n * Business Schema Module\n *\n * Exports the default business schema and utilities for working with\n * business definitions.\n */\n\nimport type { BusinessSchema, BusinessDomain, NounSchema } from '../types'\n\n// Import all domain nouns\nimport {\n adminNouns,\n businessNouns,\n productNouns,\n successNouns,\n salesNouns,\n marketingNouns,\n workNouns,\n financialNouns,\n communicationsNouns,\n} from './domains'\n\n// Re-export all domains\nexport * from './domains'\n\n/**\n * The default business schema\n *\n * This represents a complete business with all standard domains.\n * Use this as a base and extend/customize for specific use cases.\n */\nexport const defaultBusinessSchema: BusinessSchema = {\n name: 'default',\n version: '1.0.0',\n description: 'Default business schema with all standard domains',\n domains: {\n admin: adminNouns,\n business: businessNouns,\n product: productNouns,\n success: successNouns,\n sales: salesNouns,\n marketing: marketingNouns,\n work: workNouns,\n financial: financialNouns,\n communications: communicationsNouns,\n },\n}\n\n/**\n * Get all nouns from a business schema as a flat array\n */\nexport function getAllNouns(schema: BusinessSchema): NounSchema[] {\n const nouns: NounSchema[] = []\n for (const domain of Object.values(schema.domains)) {\n if (domain) {\n nouns.push(...domain)\n }\n }\n return nouns\n}\n\n/**\n * Get nouns for a specific domain\n */\nexport function getDomainNouns(\n schema: BusinessSchema,\n domain: BusinessDomain\n): NounSchema[] {\n return schema.domains[domain] || []\n}\n\n/**\n * Find a noun by slug across all domains\n */\nexport function findNounBySlug(\n schema: BusinessSchema,\n slug: string\n): NounSchema | undefined {\n for (const domain of Object.values(schema.domains)) {\n if (domain) {\n const noun = domain.find((n) => n.slug === slug)\n if (noun) return noun\n }\n }\n return undefined\n}\n\n/**\n * Get all domain names in a schema\n */\nexport function getDomains(schema: BusinessSchema): BusinessDomain[] {\n return Object.keys(schema.domains) as BusinessDomain[]\n}\n\n/**\n * Merge two business schemas\n *\n * The extension schema's nouns override the base schema's nouns\n * when they have the same slug.\n */\nexport function mergeSchemas(\n base: BusinessSchema,\n extension: Partial<BusinessSchema>\n): BusinessSchema {\n const merged: BusinessSchema = {\n name: extension.name || base.name,\n version: extension.version || base.version,\n description: extension.description || base.description,\n domains: { ...base.domains },\n }\n\n if (extension.domains) {\n for (const [domain, nouns] of Object.entries(extension.domains)) {\n if (nouns) {\n const existing = merged.domains[domain as BusinessDomain] || []\n const existingSlugs = new Set(existing.map((n) => n.slug))\n\n // Add new nouns and override existing ones\n const newNouns = nouns.filter((n) => !existingSlugs.has(n.slug))\n const overrides = nouns.filter((n) => existingSlugs.has(n.slug))\n\n merged.domains[domain as BusinessDomain] = [\n ...existing.filter((n) => !overrides.find((o) => o.slug === n.slug)),\n ...overrides,\n ...newNouns,\n ]\n }\n }\n }\n\n return merged\n}\n\n/**\n * Create a minimal business schema with only specified domains\n */\nexport function createMinimalSchema(\n domains: BusinessDomain[],\n options?: { name?: string; version?: string }\n): BusinessSchema {\n const schema: BusinessSchema = {\n name: options?.name || 'minimal',\n version: options?.version || '1.0.0',\n domains: {},\n }\n\n for (const domain of domains) {\n schema.domains[domain] = defaultBusinessSchema.domains[domain]\n }\n\n return schema\n}\n\n/**\n * Validate a business schema\n */\nexport function validateSchema(schema: BusinessSchema): string[] {\n const errors: string[] = []\n\n if (!schema.name) {\n errors.push('Schema must have a name')\n }\n\n if (!schema.version) {\n errors.push('Schema must have a version')\n }\n\n const allSlugs = new Set<string>()\n for (const [domain, nouns] of Object.entries(schema.domains)) {\n if (nouns) {\n for (const noun of nouns) {\n if (!noun.slug) {\n errors.push(`Noun in domain '${domain}' is missing a slug`)\n } else if (allSlugs.has(noun.slug)) {\n errors.push(`Duplicate slug '${noun.slug}' found in domain '${domain}'`)\n } else {\n allSlugs.add(noun.slug)\n }\n\n if (!noun.fields || noun.fields.length === 0) {\n errors.push(`Noun '${noun.slug}' has no fields`)\n }\n }\n }\n }\n\n return errors\n}\n","/**\n * MDX Loader\n *\n * Load business schemas from MDX files using the DSL parser from db.sb\n */\n\nimport { parseMDXAsync, extractNodesByName, type DSLNode } from 'db.sb'\nimport type { BusinessSchema, NounSchema, FieldSchema, LoaderOptions, BusinessDomain } from '../types'\n\n/**\n * Convert a DSLNode to a NounSchema\n */\nfunction nodeToNounSchema(node: DSLNode): NounSchema {\n const fields: FieldSchema[] = []\n\n if (node.children) {\n for (const child of node.children) {\n if (typeof child === 'object' && '__dsl' in child) {\n const fieldNode = child as DSLNode\n fields.push({\n name: fieldNode.name,\n type: fieldNode.type as any,\n required: fieldNode.props.required as boolean,\n unique: fieldNode.props.unique as boolean,\n config: fieldNode.props,\n })\n }\n }\n }\n\n return {\n slug: node.props.slug as string || node.name,\n group: node.props.group as string,\n titleField: node.props.titleField as string || node.props.useAsTitle as string,\n fields,\n }\n}\n\n/**\n * Load a business schema from MDX source\n *\n * @example\n * ```typescript\n * const mdx = `\n * <Business name=\"My Startup\">\n * <Noun name=\"Customer\" group=\"Success\">\n * <Name text required />\n * <Email />\n * <Status status=\"active|inactive|churned\" />\n * </Noun>\n * </Business>\n * `\n * const schema = await loadFromMDX(mdx)\n * ```\n */\nexport async function loadFromMDX(\n source: string,\n options: LoaderOptions = {}\n): Promise<BusinessSchema> {\n const ast = await parseMDXAsync(source, options.context || 'app')\n\n // Extract business name and version from root node\n const name = ast.props.name as string || 'unnamed'\n const version = ast.props.version as string || '1.0.0'\n const description = ast.props.description as string\n\n // Extract all Noun nodes\n const nounNodes = extractNodesByName(ast, 'noun')\n\n // Group nouns by their group property (which maps to domain)\n const domains: Partial<Record<BusinessDomain, NounSchema[]>> = {}\n\n for (const node of nounNodes) {\n const noun = nodeToNounSchema(node)\n const group = (noun.group?.toLowerCase() || 'business') as BusinessDomain\n\n if (!domains[group]) {\n domains[group] = []\n }\n domains[group]!.push(noun)\n }\n\n return {\n name,\n version,\n description,\n domains,\n }\n}\n\n/**\n * Load a single noun definition from MDX\n *\n * @example\n * ```typescript\n * const mdx = `\n * <Noun name=\"Customer\" group=\"Success\">\n * <Name text required />\n * <Email />\n * </Noun>\n * `\n * const noun = await loadNounFromMDX(mdx)\n * ```\n */\nexport async function loadNounFromMDX(\n source: string,\n options: LoaderOptions = {}\n): Promise<NounSchema> {\n const ast = await parseMDXAsync(source, options.context || 'noun')\n\n // The root should be a Noun node\n if (ast.name !== 'noun') {\n // Try to find a Noun node\n const nounNodes = extractNodesByName(ast, 'noun')\n if (nounNodes.length === 0) {\n throw new Error('No Noun definition found in MDX')\n }\n return nodeToNounSchema(nounNodes[0])\n }\n\n return nodeToNounSchema(ast)\n}\n\n/**\n * Load multiple noun definitions from MDX\n */\nexport async function loadNounsFromMDX(\n source: string,\n options: LoaderOptions = {}\n): Promise<NounSchema[]> {\n const ast = await parseMDXAsync(source, options.context || 'app')\n const nounNodes = extractNodesByName(ast, 'noun')\n return nounNodes.map(nodeToNounSchema)\n}\n","/**\n * YAML Loader\n *\n * Load business schemas from YAML files\n */\n\nimport YAML from 'yaml'\nimport type { BusinessSchema, NounSchema, FieldSchema, LoaderOptions, BusinessDomain, FieldShorthand } from '../types'\n\n/**\n * Parse a field shorthand into a FieldSchema\n *\n * Supports formats like:\n * - \"email\" -> { type: 'email' }\n * - \"text required\" -> { type: 'text', required: true }\n * - \"status:active|inactive\" -> { type: 'status', options: ['active', 'inactive'] }\n * - \"ref:customers\" -> { type: 'ref', to: 'customers' }\n */\nfunction parseFieldShorthand(name: string, value: FieldShorthand): FieldSchema {\n if (typeof value === 'object') {\n // Spread value first, then override with name to avoid duplicate key\n return { ...value, name } as FieldSchema\n }\n\n const parts = value.split(' ')\n const field: FieldSchema = { name, type: 'text' }\n\n for (const part of parts) {\n if (part === 'required') {\n field.required = true\n } else if (part === 'unique') {\n field.unique = true\n } else if (part.includes(':')) {\n const [type, options] = part.split(':')\n field.type = type as any\n\n if (type === 'status' || type === 'select') {\n field.options = options.split('|')\n } else if (type === 'ref') {\n // Use 'to' property for relationships (DSL uses 'to', Payload uses 'relationTo')\n field.to = options\n }\n } else {\n // It's a type name\n field.type = part as any\n }\n }\n\n return field\n}\n\n/**\n * Parse a YAML noun definition into a NounSchema\n */\nfunction parseNoun(data: any): NounSchema {\n const fields: FieldSchema[] = []\n\n if (data.fields) {\n if (Array.isArray(data.fields)) {\n // Fields as array of objects\n for (const field of data.fields) {\n fields.push(field as FieldSchema)\n }\n } else {\n // Fields as object (shorthand format)\n for (const [name, value] of Object.entries(data.fields)) {\n fields.push(parseFieldShorthand(name, value as FieldShorthand))\n }\n }\n }\n\n return {\n slug: data.slug || data.name?.toLowerCase().replace(/\\s+/g, '-'),\n group: data.group,\n titleField: data.titleField || data.useAsTitle,\n fields,\n }\n}\n\n/**\n * Load a business schema from YAML source\n *\n * @example\n * ```yaml\n * name: My Startup\n * version: 1.0.0\n *\n * domains:\n * success:\n * - name: Customer\n * titleField: name\n * fields:\n * name: text required\n * email: email\n * status: status:active|inactive|churned\n * healthScore: score\n * ```\n */\nexport function loadFromYAML(\n source: string,\n _options: LoaderOptions = {}\n): BusinessSchema {\n const data = YAML.parse(source)\n\n const schema: BusinessSchema = {\n name: data.name || 'unnamed',\n version: data.version || '1.0.0',\n description: data.description,\n domains: {},\n }\n\n if (data.domains) {\n for (const [domain, nouns] of Object.entries(data.domains)) {\n if (Array.isArray(nouns)) {\n schema.domains[domain as BusinessDomain] = nouns.map(parseNoun)\n }\n }\n }\n\n // Also support flat noun definitions under a 'nouns' key\n if (data.nouns) {\n for (const nounData of data.nouns) {\n const noun = parseNoun(nounData)\n const domain = (noun.group?.toLowerCase() || 'business') as BusinessDomain\n\n if (!schema.domains[domain]) {\n schema.domains[domain] = []\n }\n schema.domains[domain]!.push(noun)\n }\n }\n\n return schema\n}\n\n/**\n * Load a single noun from YAML\n */\nexport function loadNounFromYAML(\n source: string,\n _options: LoaderOptions = {}\n): NounSchema {\n const data = YAML.parse(source)\n return parseNoun(data)\n}\n\n/**\n * Load multiple nouns from YAML\n */\nexport function loadNounsFromYAML(\n source: string,\n _options: LoaderOptions = {}\n): NounSchema[] {\n const data = YAML.parse(source)\n\n if (Array.isArray(data)) {\n return data.map(parseNoun)\n }\n\n if (data.nouns) {\n return data.nouns.map(parseNoun)\n }\n\n // Single noun\n return [parseNoun(data)]\n}\n\n/**\n * Serialize a business schema to YAML\n */\nexport function toYAML(schema: BusinessSchema): string {\n return YAML.stringify({\n name: schema.name,\n version: schema.version,\n description: schema.description,\n domains: schema.domains,\n })\n}\n\n/**\n * Serialize a noun to YAML\n */\nexport function nounToYAML(noun: NounSchema): string {\n return YAML.stringify(noun)\n}\n","/**\n * JSON Loader\n *\n * Load business schemas from JSON files\n */\n\nimport type { BusinessSchema, NounSchema, FieldSchema, LoaderOptions, BusinessDomain, FieldShorthand } from '../types'\n\n/**\n * Parse a field shorthand into a FieldSchema\n *\n * Supports formats like:\n * - \"email\" -> { type: 'email' }\n * - \"text required\" -> { type: 'text', required: true }\n * - \"status:active|inactive\" -> { type: 'status', options: ['active', 'inactive'] }\n * - \"ref:customers\" -> { type: 'ref', to: 'customers' }\n */\nfunction parseFieldShorthand(name: string, value: FieldShorthand): FieldSchema {\n if (typeof value === 'object') {\n // Spread value first, then override with name to avoid duplicate key\n return { ...value, name } as FieldSchema\n }\n\n const parts = value.split(' ')\n const field: FieldSchema = { name, type: 'text' }\n\n for (const part of parts) {\n if (part === 'required') {\n field.required = true\n } else if (part === 'unique') {\n field.unique = true\n } else if (part.includes(':')) {\n const [type, options] = part.split(':')\n field.type = type as any\n\n if (type === 'status' || type === 'select') {\n field.options = options.split('|')\n } else if (type === 'ref') {\n // Use 'to' property for relationships (DSL uses 'to', Payload uses 'relationTo')\n field.to = options\n }\n } else {\n field.type = part as any\n }\n }\n\n return field\n}\n\n/**\n * Parse a JSON noun definition into a NounSchema\n */\nfunction parseNoun(data: any): NounSchema {\n const fields: FieldSchema[] = []\n\n if (data.fields) {\n if (Array.isArray(data.fields)) {\n for (const field of data.fields) {\n fields.push(field as FieldSchema)\n }\n } else {\n for (const [name, value] of Object.entries(data.fields)) {\n fields.push(parseFieldShorthand(name, value as FieldShorthand))\n }\n }\n }\n\n return {\n slug: data.slug || data.name?.toLowerCase().replace(/\\s+/g, '-'),\n group: data.group,\n titleField: data.titleField || data.useAsTitle,\n fields,\n }\n}\n\n/**\n * Load a business schema from JSON source\n *\n * @example\n * ```json\n * {\n * \"name\": \"My Startup\",\n * \"version\": \"1.0.0\",\n * \"domains\": {\n * \"success\": [\n * {\n * \"name\": \"Customer\",\n * \"titleField\": \"name\",\n * \"fields\": {\n * \"name\": \"text required\",\n * \"email\": \"email\",\n * \"status\": \"status:active|inactive|churned\"\n * }\n * }\n * ]\n * }\n * }\n * ```\n */\nexport function loadFromJSON(\n source: string,\n _options: LoaderOptions = {}\n): BusinessSchema {\n const data = JSON.parse(source)\n\n const schema: BusinessSchema = {\n name: data.name || 'unnamed',\n version: data.version || '1.0.0',\n description: data.description,\n domains: {},\n }\n\n if (data.domains) {\n for (const [domain, nouns] of Object.entries(data.domains)) {\n if (Array.isArray(nouns)) {\n schema.domains[domain as BusinessDomain] = nouns.map(parseNoun)\n }\n }\n }\n\n if (data.nouns) {\n for (const nounData of data.nouns) {\n const noun = parseNoun(nounData)\n const domain = (noun.group?.toLowerCase() || 'business') as BusinessDomain\n\n if (!schema.domains[domain]) {\n schema.domains[domain] = []\n }\n schema.domains[domain]!.push(noun)\n }\n }\n\n return schema\n}\n\n/**\n * Load a single noun from JSON\n */\nexport function loadNounFromJSON(\n source: string,\n _options: LoaderOptions = {}\n): NounSchema {\n const data = JSON.parse(source)\n return parseNoun(data)\n}\n\n/**\n * Load multiple nouns from JSON\n */\nexport function loadNounsFromJSON(\n source: string,\n _options: LoaderOptions = {}\n): NounSchema[] {\n const data = JSON.parse(source)\n\n if (Array.isArray(data)) {\n return data.map(parseNoun)\n }\n\n if (data.nouns) {\n return data.nouns.map(parseNoun)\n }\n\n return [parseNoun(data)]\n}\n\n/**\n * Serialize a business schema to JSON\n */\nexport function toJSON(schema: BusinessSchema, pretty = true): string {\n return JSON.stringify(\n {\n name: schema.name,\n version: schema.version,\n description: schema.description,\n domains: schema.domains,\n },\n null,\n pretty ? 2 : undefined\n )\n}\n\n/**\n * Serialize a noun to JSON\n */\nexport function nounToJSON(noun: NounSchema, pretty = true): string {\n return JSON.stringify(noun, null, pretty ? 2 : undefined)\n}\n","/**\n * Loaders Module\n *\n * Load business schemas from various formats (MDX, YAML, JSON)\n */\n\nimport type { BusinessSchema, NounSchema, LoaderOptions, LoadResult } from '../types'\n\n// Export all loader functions\nexport * from './mdx'\nexport * from './yaml'\nexport * from './json'\n\n// Import for unified loader\nimport { loadFromMDX, loadNounFromMDX, loadNounsFromMDX } from './mdx'\nimport { loadFromYAML, loadNounFromYAML, loadNounsFromYAML, toYAML, nounToYAML } from './yaml'\nimport { loadFromJSON, loadNounFromJSON, loadNounsFromJSON, toJSON, nounToJSON } from './json'\n\n/**\n * Detect format from source content\n */\nfunction detectFormat(source: string): 'mdx' | 'yaml' | 'json' {\n const trimmed = source.trim()\n\n // JSON starts with { or [\n if (trimmed.startsWith('{') || trimmed.startsWith('[')) {\n return 'json'\n }\n\n // MDX contains JSX tags\n if (trimmed.includes('<') && trimmed.includes('>')) {\n return 'mdx'\n }\n\n // Default to YAML\n return 'yaml'\n}\n\n/**\n * Load a business schema from any supported format\n *\n * Automatically detects the format from the source content.\n */\nexport async function load(\n source: string,\n options: LoaderOptions & { format?: 'mdx' | 'yaml' | 'json' } = {}\n): Promise<LoadResult> {\n const format = options.format || detectFormat(source)\n\n let schema: BusinessSchema\n\n switch (format) {\n case 'mdx':\n schema = await loadFromMDX(source, options)\n break\n case 'yaml':\n schema = loadFromYAML(source, options)\n break\n case 'json':\n schema = loadFromJSON(source, options)\n break\n default:\n throw new Error(`Unsupported format: ${format}`)\n }\n\n return {\n schema,\n format,\n }\n}\n\n/**\n * Load a single noun from any supported format\n */\nexport async function loadNoun(\n source: string,\n options: LoaderOptions & { format?: 'mdx' | 'yaml' | 'json' } = {}\n): Promise<NounSchema> {\n const format = options.format || detectFormat(source)\n\n switch (format) {\n case 'mdx':\n return loadNounFromMDX(source, options)\n case 'yaml':\n return loadNounFromYAML(source, options)\n case 'json':\n return loadNounFromJSON(source, options)\n default:\n throw new Error(`Unsupported format: ${format}`)\n }\n}\n\n/**\n * Load multiple nouns from any supported format\n */\nexport async function loadNouns(\n source: string,\n options: LoaderOptions & { format?: 'mdx' | 'yaml' | 'json' } = {}\n): Promise<NounSchema[]> {\n const format = options.format || detectFormat(source)\n\n switch (format) {\n case 'mdx':\n return loadNounsFromMDX(source, options)\n case 'yaml':\n return loadNounsFromYAML(source, options)\n case 'json':\n return loadNounsFromJSON(source, options)\n default:\n throw new Error(`Unsupported format: ${format}`)\n }\n}\n\n/**\n * Serialize a business schema to a specific format\n */\nexport function serialize(\n schema: BusinessSchema,\n format: 'yaml' | 'json' = 'yaml'\n): string {\n switch (format) {\n case 'yaml':\n return toYAML(schema)\n case 'json':\n return toJSON(schema)\n default:\n throw new Error(`Unsupported format: ${format}`)\n }\n}\n\n/**\n * Serialize a noun to a specific format\n */\nexport function serializeNoun(\n noun: NounSchema,\n format: 'yaml' | 'json' = 'yaml'\n): string {\n switch (format) {\n case 'yaml':\n return nounToYAML(noun)\n case 'json':\n return nounToJSON(noun)\n default:\n throw new Error(`Unsupported format: ${format}`)\n }\n}\n"],"mappings":";AAMO,IAAM,QAAoB;AAAA,EAC/B,MAAM;AAAA,EACN,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,QAAQ;AAAA,IACN,EAAE,MAAM,SAAS,MAAM,SAAS,UAAU,MAAM,QAAQ,KAAK;AAAA,IAC7D,EAAE,MAAM,QAAQ,MAAM,OAAO;AAAA,IAC7B,EAAE,MAAM,UAAU,MAAM,QAAQ;AAAA,IAChC,EAAE,MAAM,QAAQ,MAAM,UAAU,SAAS,CAAC,SAAS,QAAQ,QAAQ,EAAE;AAAA,EACvE;AACF;AAEO,IAAM,OAAmB;AAAA,EAC9B,MAAM;AAAA,EACN,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,QAAQ;AAAA,IACN,EAAE,MAAM,QAAQ,MAAM,QAAQ,UAAU,KAAK;AAAA,IAC7C,EAAE,MAAM,QAAQ,MAAM,QAAQ,UAAU,MAAM,QAAQ,KAAK;AAAA,IAC3D,EAAE,MAAM,QAAQ,MAAM,QAAQ;AAAA,IAC9B,EAAE,MAAM,UAAU,MAAM,OAAO;AAAA,EACjC;AACF;AAEO,IAAM,kBAA8B;AAAA,EACzC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,QAAQ;AAAA,IACN,EAAE,MAAM,QAAQ,MAAM,QAAQ,UAAU,KAAK;AAAA,IAC7C,EAAE,MAAM,OAAO,MAAM,OAAO,QAAQ,EAAE,YAAY,OAAO,EAAE;AAAA,IAC3D,EAAE,MAAM,UAAU,MAAM,QAAQ,QAAQ,KAAK;AAAA,IAC7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SAA0B,QAClB;AACR,UAAQ,QAAQ;AAAA,IACd,KAAK;AACH,aAAO,WAAW,IAAI;AAAA,IACxB,KAAK;AACH,aAAO,WAAW,IAAI;AAAA,IACxB;AACE,YAAM,IAAI,MAAM,uBAAuB,MAAM,EAAE;AAAA,EACnD;AACF;","names":["parseFieldShorthand","parseNoun"]}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { L as LoaderOptions, B as BusinessSchema, c as LoadResult } from '../types-CJ9eGS_C.js';
|
|
2
|
+
import { NounSchema } from 'db.sb';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* MDX Loader
|
|
6
|
+
*
|
|
7
|
+
* Load business schemas from MDX files using the DSL parser from db.sb
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Load a business schema from MDX source
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const mdx = `
|
|
16
|
+
* <Business name="My Startup">
|
|
17
|
+
* <Noun name="Customer" group="Success">
|
|
18
|
+
* <Name text required />
|
|
19
|
+
* <Email />
|
|
20
|
+
* <Status status="active|inactive|churned" />
|
|
21
|
+
* </Noun>
|
|
22
|
+
* </Business>
|
|
23
|
+
* `
|
|
24
|
+
* const schema = await loadFromMDX(mdx)
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
declare function loadFromMDX(source: string, options?: LoaderOptions): Promise<BusinessSchema>;
|
|
28
|
+
/**
|
|
29
|
+
* Load a single noun definition from MDX
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* const mdx = `
|
|
34
|
+
* <Noun name="Customer" group="Success">
|
|
35
|
+
* <Name text required />
|
|
36
|
+
* <Email />
|
|
37
|
+
* </Noun>
|
|
38
|
+
* `
|
|
39
|
+
* const noun = await loadNounFromMDX(mdx)
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
declare function loadNounFromMDX(source: string, options?: LoaderOptions): Promise<NounSchema>;
|
|
43
|
+
/**
|
|
44
|
+
* Load multiple noun definitions from MDX
|
|
45
|
+
*/
|
|
46
|
+
declare function loadNounsFromMDX(source: string, options?: LoaderOptions): Promise<NounSchema[]>;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* YAML Loader
|
|
50
|
+
*
|
|
51
|
+
* Load business schemas from YAML files
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Load a business schema from YAML source
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```yaml
|
|
59
|
+
* name: My Startup
|
|
60
|
+
* version: 1.0.0
|
|
61
|
+
*
|
|
62
|
+
* domains:
|
|
63
|
+
* success:
|
|
64
|
+
* - name: Customer
|
|
65
|
+
* titleField: name
|
|
66
|
+
* fields:
|
|
67
|
+
* name: text required
|
|
68
|
+
* email: email
|
|
69
|
+
* status: status:active|inactive|churned
|
|
70
|
+
* healthScore: score
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
declare function loadFromYAML(source: string, _options?: LoaderOptions): BusinessSchema;
|
|
74
|
+
/**
|
|
75
|
+
* Load a single noun from YAML
|
|
76
|
+
*/
|
|
77
|
+
declare function loadNounFromYAML(source: string, _options?: LoaderOptions): NounSchema;
|
|
78
|
+
/**
|
|
79
|
+
* Load multiple nouns from YAML
|
|
80
|
+
*/
|
|
81
|
+
declare function loadNounsFromYAML(source: string, _options?: LoaderOptions): NounSchema[];
|
|
82
|
+
/**
|
|
83
|
+
* Serialize a business schema to YAML
|
|
84
|
+
*/
|
|
85
|
+
declare function toYAML(schema: BusinessSchema): string;
|
|
86
|
+
/**
|
|
87
|
+
* Serialize a noun to YAML
|
|
88
|
+
*/
|
|
89
|
+
declare function nounToYAML(noun: NounSchema): string;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* JSON Loader
|
|
93
|
+
*
|
|
94
|
+
* Load business schemas from JSON files
|
|
95
|
+
*/
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Load a business schema from JSON source
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```json
|
|
102
|
+
* {
|
|
103
|
+
* "name": "My Startup",
|
|
104
|
+
* "version": "1.0.0",
|
|
105
|
+
* "domains": {
|
|
106
|
+
* "success": [
|
|
107
|
+
* {
|
|
108
|
+
* "name": "Customer",
|
|
109
|
+
* "titleField": "name",
|
|
110
|
+
* "fields": {
|
|
111
|
+
* "name": "text required",
|
|
112
|
+
* "email": "email",
|
|
113
|
+
* "status": "status:active|inactive|churned"
|
|
114
|
+
* }
|
|
115
|
+
* }
|
|
116
|
+
* ]
|
|
117
|
+
* }
|
|
118
|
+
* }
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
declare function loadFromJSON(source: string, _options?: LoaderOptions): BusinessSchema;
|
|
122
|
+
/**
|
|
123
|
+
* Load a single noun from JSON
|
|
124
|
+
*/
|
|
125
|
+
declare function loadNounFromJSON(source: string, _options?: LoaderOptions): NounSchema;
|
|
126
|
+
/**
|
|
127
|
+
* Load multiple nouns from JSON
|
|
128
|
+
*/
|
|
129
|
+
declare function loadNounsFromJSON(source: string, _options?: LoaderOptions): NounSchema[];
|
|
130
|
+
/**
|
|
131
|
+
* Serialize a business schema to JSON
|
|
132
|
+
*/
|
|
133
|
+
declare function toJSON(schema: BusinessSchema, pretty?: boolean): string;
|
|
134
|
+
/**
|
|
135
|
+
* Serialize a noun to JSON
|
|
136
|
+
*/
|
|
137
|
+
declare function nounToJSON(noun: NounSchema, pretty?: boolean): string;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Loaders Module
|
|
141
|
+
*
|
|
142
|
+
* Load business schemas from various formats (MDX, YAML, JSON)
|
|
143
|
+
*/
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Load a business schema from any supported format
|
|
147
|
+
*
|
|
148
|
+
* Automatically detects the format from the source content.
|
|
149
|
+
*/
|
|
150
|
+
declare function load(source: string, options?: LoaderOptions & {
|
|
151
|
+
format?: 'mdx' | 'yaml' | 'json';
|
|
152
|
+
}): Promise<LoadResult>;
|
|
153
|
+
/**
|
|
154
|
+
* Load a single noun from any supported format
|
|
155
|
+
*/
|
|
156
|
+
declare function loadNoun(source: string, options?: LoaderOptions & {
|
|
157
|
+
format?: 'mdx' | 'yaml' | 'json';
|
|
158
|
+
}): Promise<NounSchema>;
|
|
159
|
+
/**
|
|
160
|
+
* Load multiple nouns from any supported format
|
|
161
|
+
*/
|
|
162
|
+
declare function loadNouns(source: string, options?: LoaderOptions & {
|
|
163
|
+
format?: 'mdx' | 'yaml' | 'json';
|
|
164
|
+
}): Promise<NounSchema[]>;
|
|
165
|
+
/**
|
|
166
|
+
* Serialize a business schema to a specific format
|
|
167
|
+
*/
|
|
168
|
+
declare function serialize(schema: BusinessSchema, format?: 'yaml' | 'json'): string;
|
|
169
|
+
/**
|
|
170
|
+
* Serialize a noun to a specific format
|
|
171
|
+
*/
|
|
172
|
+
declare function serializeNoun(noun: NounSchema, format?: 'yaml' | 'json'): string;
|
|
173
|
+
|
|
174
|
+
export { load, loadFromJSON, loadFromMDX, loadFromYAML, loadNoun, loadNounFromJSON, loadNounFromMDX, loadNounFromYAML, loadNouns, loadNounsFromJSON, loadNounsFromMDX, loadNounsFromYAML, nounToJSON, nounToYAML, serialize, serializeNoun, toJSON, toYAML };
|