@burdenoff/microfe-admin 2026.830.1 → 2026.925.2

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.
@@ -174,20 +174,20 @@ var E = 20, D = {
174
174
  }
175
175
  },
176
176
  {
177
- name: "Botlit",
177
+ name: "BotManor",
178
178
  slug: "botlit",
179
179
  description: "Enterprise AI agent and bot automation platform.",
180
180
  status: "ACTIVE",
181
- website: "https://botlit.ai",
181
+ website: "https://www.botmanor.com",
182
182
  appUrl: "https://botlit.local.burdenoff.com/",
183
- docsUrl: "https://docs.botlit.ai",
183
+ docsUrl: "https://docs.botmanor.com",
184
184
  githubUrl: "https://github.com/algoshred/botlit",
185
185
  statusPageUrl: "https://status.burdenoff.com",
186
186
  contactEmail: "contact@botlit.ai",
187
187
  supportEmail: "support@burdenoff.com",
188
188
  contactPhone: "+91-7358445777",
189
189
  contactAddress: "Plot No.43, Veeramani Nagar, 2nd Cross Street, Nanmangalam, Chennai - 600117",
190
- seoTitle: "Botlit - Enterprise AI Agent Platform",
190
+ seoTitle: "BotManor - Enterprise AI Agent Platform",
191
191
  seoDescription: "The Enterprise AI Platform That Makes Intelligent Automation Accessible to Everyone",
192
192
  seoKeywords: "AI,bots,automation,agentic AI,intelligent automation,chatbot,enterprise AI",
193
193
  socialLinks: {
@@ -1 +1 @@
1
- {"version":3,"file":"ProductsPage.js","names":[],"sources":["../../../src/admin/pages/ProductsPage.tsx"],"sourcesContent":["import { useState, useMemo, useCallback } from 'react';\nimport { gql } from '@apollo/client';\nimport { useApolloClient } from '@apollo/client/react';\nimport { Package, Search, ExternalLink, Server, Database } from 'lucide-react';\nimport { useAdminPermissions } from '../hooks/useAdminPermissions';\nimport {\n PageLayout,\n Input,\n DataTable,\n Pagination,\n EmptyState,\n MetricCard,\n MetricsGrid,\n Badge,\n Button,\n PermissionGuard,\n} from '../components';\nimport { formatDate } from '../utils/formatters';\nimport { PagePurpose } from '@burdenoff/fe-libs/ui';\nimport {\n useListPlatformProductsQuery,\n useGetPlatformProductStatsQuery,\n} from '../../generated/global-operations';\n\nconst PAGE_SIZE = 20;\n\ntype ProductStatus = 'ACTIVE' | 'COMING_SOON' | 'WAITLIST' | 'DRAFT';\n\nconst STATUS_VARIANT: Record<ProductStatus, 'default' | 'secondary' | 'outline' | 'destructive'> = {\n ACTIVE: 'default',\n COMING_SOON: 'secondary',\n WAITLIST: 'outline',\n DRAFT: 'destructive',\n};\n\nconst PLATFORM_PRODUCT_FIELDS = gql`\n fragment AdminSeedPlatformProductFields on PlatformProduct {\n id\n name\n slug\n }\n`;\n\nconst UPSERT_PRODUCTS_QUERY = gql`\n ${PLATFORM_PRODUCT_FIELDS}\n query AdminSeedListProducts($limit: Int, $offset: Int) {\n platformProducts(limit: $limit, offset: $offset) {\n items {\n ...AdminSeedPlatformProductFields\n }\n }\n }\n`;\n\nconst CREATE_PRODUCT_MUTATION = gql`\n mutation AdminSeedCreateProduct($input: CreatePlatformProductInput!) {\n createPlatformProduct(input: $input) {\n id\n slug\n }\n }\n`;\n\nconst UPDATE_PRODUCT_MUTATION = gql`\n mutation AdminSeedUpdateProduct($id: ID!, $input: UpdatePlatformProductInput!) {\n updatePlatformProduct(id: $id, input: $input) {\n id\n slug\n }\n }\n`;\n\ntype SeedProductInput = {\n name: string;\n slug: string;\n description: string;\n status: ProductStatus;\n website: string | null;\n appUrl: string;\n docsUrl: string | null;\n githubUrl: string;\n statusPageUrl: string;\n contactEmail: string;\n supportEmail: string;\n contactPhone: string;\n contactAddress: string;\n seoTitle: string;\n seoDescription: string;\n seoKeywords: string;\n socialLinks: Record<string, string>;\n metadata: Record<string, string>;\n};\n\nconst PRODUCT_SEEDS: SeedProductInput[] = [\n {\n name: 'Workspaces',\n slug: 'workspaces',\n description: 'Enterprise collaboration and workspace management platform.',\n status: 'ACTIVE',\n website: 'https://workspaces.burdenoff.com',\n appUrl: 'https://app.local.burdenoff.com/',\n docsUrl: 'https://docs.burdenoff.com/workspaces',\n githubUrl: 'https://github.com/algoshred/workspaces',\n statusPageUrl: 'https://status.burdenoff.com',\n contactEmail: 'contact@burdenoff.com',\n supportEmail: 'support@burdenoff.com',\n contactPhone: '+91-7358445777',\n contactAddress: 'Plot No.43, Veeramani Nagar, 2nd Cross Street, Nanmangalam, Chennai - 600117',\n seoTitle: 'Workspaces - Enterprise Collaboration Platform',\n seoDescription: 'The enterprise-grade foundation for collaborative digital workspaces.',\n seoKeywords: 'enterprise,collaboration,workspace,saas,multi-tenant',\n socialLinks: {\n twitter: 'https://twitter.com/burdenoff',\n github: 'https://github.com/algoshred',\n discord: 'https://discord.gg/burdenoff',\n linkedin: 'https://linkedin.com/company/burdenoff',\n },\n metadata: {\n tagline: 'The Enterprise-Grade Foundation for Collaborative Digital Workspaces',\n businessDomain: 'Enterprise Collaboration & Workspace Management',\n category: 'Core Infrastructure',\n company: 'algoshred',\n pricingRange: '$15-$125/user/month',\n },\n },\n {\n name: 'VibeControls',\n slug: 'vibecontrols',\n description: 'Developer control panel for environments, terminals, tunnels, and remote work.',\n status: 'ACTIVE',\n website: 'https://vibecontrols.com',\n appUrl: 'https://vibecontrols.local.burdenoff.com/',\n docsUrl: 'https://docs.vibecontrols.com',\n githubUrl: 'https://github.com/algoshred/vibecontrols',\n statusPageUrl: 'https://status.burdenoff.com',\n contactEmail: 'contact@vibecontrols.com',\n supportEmail: 'support@burdenoff.com',\n contactPhone: '+91-7358445777',\n contactAddress: 'Plot No.43, Veeramani Nagar, 2nd Cross Street, Nanmangalam, Chennai - 600117',\n seoTitle: 'VibeControls - Developer Environment Management',\n seoDescription: \"The Developer's Command Center for Multi-Environment Development\",\n seoKeywords: 'developer tools,environment management,terminal,remote development,devops',\n socialLinks: {\n twitter: 'https://twitter.com/burdenoff',\n github: 'https://github.com/algoshred',\n discord: 'https://discord.gg/burdenoff',\n linkedin: 'https://linkedin.com/company/burdenoff',\n },\n metadata: {\n tagline: \"The Developer's Command Center for Multi-Environment Development\",\n businessDomain: 'Developer Control Panel',\n category: 'Core Infrastructure',\n company: 'algoshred',\n pricingRange: '$25-$150/user/month',\n },\n },\n {\n name: 'FluidGrids',\n slug: 'fluidgrids',\n description:\n 'Visual workflow automation platform for building and operating complex workflows.',\n status: 'ACTIVE',\n website: 'https://fluidgrids.com',\n appUrl: 'https://fluidgrids.local.burdenoff.com/',\n docsUrl: 'https://docs.fluidgrids.com',\n githubUrl: 'https://github.com/algoshred/fluidgrids',\n statusPageUrl: 'https://status.burdenoff.com',\n contactEmail: 'contact@fluidgrids.com',\n supportEmail: 'support@burdenoff.com',\n contactPhone: '+91-7358445777',\n contactAddress: 'Plot No.43, Veeramani Nagar, 2nd Cross Street, Nanmangalam, Chennai - 600117',\n seoTitle: 'FluidGrids - Visual Workflow Automation',\n seoDescription:\n 'The Visual Automation Platform That Scales From Simple Tasks to Enterprise Workflows',\n seoKeywords: 'workflow,automation,drag-and-drop,visual,enterprise,integration,process',\n socialLinks: {\n twitter: 'https://twitter.com/burdenoff',\n github: 'https://github.com/algoshred',\n discord: 'https://discord.gg/burdenoff',\n linkedin: 'https://linkedin.com/company/burdenoff',\n },\n metadata: {\n tagline:\n 'The Visual Automation Platform That Scales From Simple Tasks to Enterprise Workflows',\n businessDomain: 'Visual Workflow Automation Platform',\n category: 'Workflow & Automation',\n company: 'algoshred',\n pricingRange: '$29-$299/user/month',\n },\n },\n {\n name: 'BigConsole',\n slug: 'bigconsole',\n description: 'AI-first dashboard and data visualization platform.',\n status: 'ACTIVE',\n website: 'https://bigconsole.com',\n appUrl: 'https://bigconsole.local.burdenoff.com/',\n docsUrl: 'https://docs.bigconsole.com',\n githubUrl: 'https://github.com/algoshred/bigconsole',\n statusPageUrl: 'https://status.burdenoff.com',\n contactEmail: 'contact@bigconsole.com',\n supportEmail: 'support@burdenoff.com',\n contactPhone: '+91-7358445777',\n contactAddress: 'Plot No.43, Veeramani Nagar, 2nd Cross Street, Nanmangalam, Chennai - 600117',\n seoTitle: 'BigConsole - AI Data Visualization Platform',\n seoDescription: 'Where Data Becomes Intelligence',\n seoKeywords: 'data visualization,business intelligence,AI,dashboard,analytics,reporting',\n socialLinks: {\n twitter: 'https://twitter.com/burdenoff',\n github: 'https://github.com/algoshred',\n discord: 'https://discord.gg/burdenoff',\n linkedin: 'https://linkedin.com/company/burdenoff',\n },\n metadata: {\n tagline: 'Where Data Becomes Intelligence',\n businessDomain: 'Data Visualization and Business Intelligence',\n category: 'AI & Intelligence',\n company: 'algoshred',\n pricingRange: '$29-$149/user/month',\n },\n },\n {\n name: 'Botlit',\n slug: 'botlit',\n description: 'Enterprise AI agent and bot automation platform.',\n status: 'ACTIVE',\n website: 'https://botlit.ai',\n appUrl: 'https://botlit.local.burdenoff.com/',\n docsUrl: 'https://docs.botlit.ai',\n githubUrl: 'https://github.com/algoshred/botlit',\n statusPageUrl: 'https://status.burdenoff.com',\n contactEmail: 'contact@botlit.ai',\n supportEmail: 'support@burdenoff.com',\n contactPhone: '+91-7358445777',\n contactAddress: 'Plot No.43, Veeramani Nagar, 2nd Cross Street, Nanmangalam, Chennai - 600117',\n seoTitle: 'Botlit - Enterprise AI Agent Platform',\n seoDescription:\n 'The Enterprise AI Platform That Makes Intelligent Automation Accessible to Everyone',\n seoKeywords: 'AI,bots,automation,agentic AI,intelligent automation,chatbot,enterprise AI',\n socialLinks: {\n twitter: 'https://twitter.com/burdenoff',\n github: 'https://github.com/algoshred',\n discord: 'https://discord.gg/burdenoff',\n linkedin: 'https://linkedin.com/company/burdenoff',\n },\n metadata: {\n tagline:\n 'The Enterprise AI Platform That Makes Intelligent Automation Accessible to Everyone',\n businessDomain: 'AI Platform',\n category: 'AI & Intelligence',\n company: 'algoshred',\n pricingRange: '$99-$1,999/month',\n },\n },\n];\n\ntype ProductItem = {\n id: string;\n name: string;\n slug: string;\n description: string | null | undefined;\n status: string;\n appUrl: string | null | undefined;\n activeUsers: number;\n apiCalls: number;\n contactEmail: string | null | undefined;\n createdAt: string;\n updatedAt: string;\n};\n\n/**\n * Products page — connected to real backend\n */\nexport function ProductsPage() {\n const { canViewProducts, isLoading: permissionsLoading } = useAdminPermissions();\n const apolloClient = useApolloClient();\n\n const [page, setPage] = useState(1);\n const [search, setSearch] = useState('');\n const [isSeeding, setIsSeeding] = useState(false);\n const [seedMessage, setSeedMessage] = useState<string | null>(null);\n const [seedError, setSeedError] = useState<string | null>(null);\n\n const skipQueries = permissionsLoading || !canViewProducts;\n\n const { data: statsData } = useGetPlatformProductStatsQuery({\n skip: skipQueries,\n });\n const { data, loading, error, refetch } = useListPlatformProductsQuery({\n variables: {\n filter: search ? { search } : undefined,\n limit: PAGE_SIZE,\n offset: (page - 1) * PAGE_SIZE,\n },\n fetchPolicy: 'cache-and-network',\n skip: skipQueries,\n });\n\n const products: ProductItem[] = useMemo(\n () => (data?.platformProducts?.items ?? []) as ProductItem[],\n [data]\n );\n\n const total = data?.platformProducts?.total ?? 0;\n const totalPages = Math.ceil(total / PAGE_SIZE);\n const stats = statsData?.platformProductStats;\n\n const handleSeedProducts = useCallback(async () => {\n setIsSeeding(true);\n setSeedMessage(null);\n setSeedError(null);\n\n try {\n const existingResult = await apolloClient.query<{\n platformProducts: { items: Array<{ id: string; slug: string }> };\n }>({\n query: UPSERT_PRODUCTS_QUERY,\n variables: { limit: 200, offset: 0 },\n fetchPolicy: 'network-only',\n });\n const existingProducts = existingResult.data?.platformProducts?.items ?? [];\n const existingBySlug = new Map(existingProducts.map((product) => [product.slug, product]));\n\n let created = 0;\n let updated = 0;\n for (const seed of PRODUCT_SEEDS) {\n const existing = existingBySlug.get(seed.slug);\n if (existing) {\n const input = Object.fromEntries(Object.entries(seed).filter(([key]) => key !== 'slug'));\n await apolloClient.mutate({\n mutation: UPDATE_PRODUCT_MUTATION,\n variables: { id: existing.id, input },\n });\n updated += 1;\n } else {\n await apolloClient.mutate({\n mutation: CREATE_PRODUCT_MUTATION,\n variables: { input: seed },\n });\n created += 1;\n }\n }\n\n setSeedMessage(`Seeded products: ${created} created, ${updated} updated.`);\n await refetch();\n } catch (err) {\n setSeedError(err instanceof Error ? err.message : 'Failed to seed products');\n } finally {\n setIsSeeding(false);\n }\n }, [apolloClient, refetch]);\n\n const columns = [\n {\n key: 'name',\n header: 'Product',\n render: (p: ProductItem) => (\n <div className=\"flex items-center gap-3\">\n <div className=\"min-w-0\">\n <div className=\"flex items-center gap-2\">\n <span className=\"font-medium text-text-primary\">{p.name}</span>\n {p.appUrl && (\n <a\n href={p.appUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={(e) => e.stopPropagation()}\n >\n <ExternalLink className=\"h-3 w-3 text-text-secondary hover:text-text-primary\" />\n </a>\n )}\n </div>\n <div className=\"truncate text-xs text-text-secondary\">{p.slug}</div>\n </div>\n </div>\n ),\n },\n {\n key: 'status',\n header: 'Status',\n width: '110px',\n render: (p: ProductItem) => (\n <Badge\n variant={STATUS_VARIANT[p.status as ProductStatus] ?? 'outline'}\n className=\"text-xs capitalize\"\n >\n {p.status.toLowerCase().replace('_', ' ')}\n </Badge>\n ),\n },\n {\n key: 'activeUsers',\n header: 'Users',\n width: '80px',\n align: 'right' as const,\n render: (p: ProductItem) => <span className=\"text-sm\">{p.activeUsers}</span>,\n },\n {\n key: 'updatedAt',\n header: 'Updated',\n width: '110px',\n render: (p: ProductItem) => formatDate(p.updatedAt),\n },\n ];\n\n return (\n <PermissionGuard\n allowed={canViewProducts}\n isLoading={permissionsLoading}\n pageTitle=\"Products\"\n denyMessage=\"You don't have permission to view products.\"\n >\n <PageLayout\n title=\"Products\"\n gradientWord=\"Products\"\n description={`Platform products and services${total ? ` · ${total} total` : ''}`}\n actions={\n <Button onClick={handleSeedProducts} disabled={isSeeding}>\n <Database className=\"mr-2 h-4 w-4\" />\n {isSeeding ? 'Seeding...' : 'Seed Active Products'}\n </Button>\n }\n >\n <PagePurpose className=\"mb-6\">\n Every product and service the platform offers lives here. Use this page to see which are\n live, in draft, or running a waitlist, and to seed the active product catalog — it&apos;s\n the source of truth other admin areas (billing, waitlist, referrals) point back to.\n </PagePurpose>\n\n {/* Stats */}\n {stats && (\n <MetricsGrid className=\"mb-6\">\n <MetricCard\n title=\"Total Products\"\n hero\n value={stats.total}\n icon={<Package className=\"h-5 w-5\" />}\n />\n <MetricCard title=\"Active\" value={stats.active} icon={<Server className=\"h-5 w-5\" />} />\n <MetricCard\n title=\"Waitlist\"\n value={stats.waitlist}\n icon={<Package className=\"h-5 w-5\" />}\n />\n <MetricCard title=\"Draft\" value={stats.draft} icon={<Package className=\"h-5 w-5\" />} />\n </MetricsGrid>\n )}\n\n <div className=\"space-y-4\">\n <div className=\"relative max-w-sm\">\n <Search className=\"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary\" />\n <Input\n placeholder=\"Search products...\"\n value={search}\n onChange={(e) => {\n setPage(1);\n setSearch(e.target.value);\n }}\n className=\"pl-9\"\n />\n </div>\n\n {error && (\n <div className=\"rounded-md border border-status-error-border/50 bg-status-error-bg/10 p-4 text-sm text-status-error-text\">\n Failed to load products: {error.message}\n </div>\n )}\n {seedMessage && (\n <div className=\"rounded-md border border-border-subtle bg-bg-sunken p-4 text-sm text-text-primary\">\n {seedMessage}\n </div>\n )}\n {seedError && (\n <div className=\"rounded-md border border-status-error-border/50 bg-status-error-bg/10 p-4 text-sm text-status-error-text\">\n {seedError}\n </div>\n )}\n\n <DataTable\n columns={columns}\n data={products}\n keyExtractor={(p) => p.id}\n loading={loading}\n emptyState={\n <EmptyState\n illustration=\"empty-search\"\n icon={<Package className=\"h-8 w-8\" />}\n title=\"No products found\"\n description=\"No platform products match your search\"\n />\n }\n />\n\n {total > PAGE_SIZE && (\n <Pagination\n page={page}\n totalPages={totalPages}\n totalItems={total}\n pageSize={PAGE_SIZE}\n onPageChange={setPage}\n />\n )}\n </div>\n </PageLayout>\n </PermissionGuard>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAwBA,IAAM,IAAY,IAIZ,IAA6F;CACjG,QAAQ;CACR,aAAa;CACb,UAAU;CACV,OAAO;CACR,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AM,EAAE;aACR,QAAO;aACP,KAAI;aACJ,UAAU,MAAM,EAAE,iBAAiB;uBAEnC,kBAAC,IAAD,EAAc,WAAU,uDAAwD,CAAA;aAC9E,CAAA,CAEF;eACN,kBAAC,OAAD;YAAK,WAAU;sBAAwC,EAAE;YAAW,CAAA,CAChE;;UACF,CAAA;SAET;QACD;SACE,KAAK;SACL,QAAQ;SACR,OAAO;SACP,SAAS,MACP,kBAAC,GAAD;UACE,SAAS,EAAe,EAAE,WAA4B;UACtD,WAAU;oBAET,EAAE,OAAO,aAAa,CAAC,QAAQ,KAAK,IAAI;UACnC,CAAA;SAEX;QACD;SACE,KAAK;SACL,QAAQ;SACR,OAAO;SACP,OAAO;SACP,SAAS,MAAmB,kBAAC,QAAD;UAAM,WAAU;oBAAW,EAAE;UAAmB,CAAA;SAC7E;QACD;SACE,KAAK;SACL,QAAQ;SACR,OAAO;SACP,SAAS,MAAmB,EAAW,EAAE,UAAU;SACpD;QACF;OA6ES,MAAM;OACN,eAAe,MAAM,EAAE;OACd;OACT,YACE,kBAAC,GAAD;QACE,cAAa;QACb,MAAM,kBAAC,GAAD,EAAS,WAAU,WAAY,CAAA;QACrC,OAAM;QACN,aAAY;QACZ,CAAA;OAEJ,CAAA;MAED,IAAQ,KACP,kBAAC,GAAD;OACQ;OACM;OACZ,YAAY;OACZ,UAAU;OACV,cAAc;OACd,CAAA;MAEA;;IACK;;EACG,CAAA"}
1
+ {"version":3,"file":"ProductsPage.js","names":[],"sources":["../../../src/admin/pages/ProductsPage.tsx"],"sourcesContent":["import { useState, useMemo, useCallback } from 'react';\nimport { gql } from '@apollo/client';\nimport { useApolloClient } from '@apollo/client/react';\nimport { Package, Search, ExternalLink, Server, Database } from 'lucide-react';\nimport { useAdminPermissions } from '../hooks/useAdminPermissions';\nimport {\n PageLayout,\n Input,\n DataTable,\n Pagination,\n EmptyState,\n MetricCard,\n MetricsGrid,\n Badge,\n Button,\n PermissionGuard,\n} from '../components';\nimport { formatDate } from '../utils/formatters';\nimport { PagePurpose } from '@burdenoff/fe-libs/ui';\nimport {\n useListPlatformProductsQuery,\n useGetPlatformProductStatsQuery,\n} from '../../generated/global-operations';\n\nconst PAGE_SIZE = 20;\n\ntype ProductStatus = 'ACTIVE' | 'COMING_SOON' | 'WAITLIST' | 'DRAFT';\n\nconst STATUS_VARIANT: Record<ProductStatus, 'default' | 'secondary' | 'outline' | 'destructive'> = {\n ACTIVE: 'default',\n COMING_SOON: 'secondary',\n WAITLIST: 'outline',\n DRAFT: 'destructive',\n};\n\nconst PLATFORM_PRODUCT_FIELDS = gql`\n fragment AdminSeedPlatformProductFields on PlatformProduct {\n id\n name\n slug\n }\n`;\n\nconst UPSERT_PRODUCTS_QUERY = gql`\n ${PLATFORM_PRODUCT_FIELDS}\n query AdminSeedListProducts($limit: Int, $offset: Int) {\n platformProducts(limit: $limit, offset: $offset) {\n items {\n ...AdminSeedPlatformProductFields\n }\n }\n }\n`;\n\nconst CREATE_PRODUCT_MUTATION = gql`\n mutation AdminSeedCreateProduct($input: CreatePlatformProductInput!) {\n createPlatformProduct(input: $input) {\n id\n slug\n }\n }\n`;\n\nconst UPDATE_PRODUCT_MUTATION = gql`\n mutation AdminSeedUpdateProduct($id: ID!, $input: UpdatePlatformProductInput!) {\n updatePlatformProduct(id: $id, input: $input) {\n id\n slug\n }\n }\n`;\n\ntype SeedProductInput = {\n name: string;\n slug: string;\n description: string;\n status: ProductStatus;\n website: string | null;\n appUrl: string;\n docsUrl: string | null;\n githubUrl: string;\n statusPageUrl: string;\n contactEmail: string;\n supportEmail: string;\n contactPhone: string;\n contactAddress: string;\n seoTitle: string;\n seoDescription: string;\n seoKeywords: string;\n socialLinks: Record<string, string>;\n metadata: Record<string, string>;\n};\n\nconst PRODUCT_SEEDS: SeedProductInput[] = [\n {\n name: 'Workspaces',\n slug: 'workspaces',\n description: 'Enterprise collaboration and workspace management platform.',\n status: 'ACTIVE',\n website: 'https://workspaces.burdenoff.com',\n appUrl: 'https://app.local.burdenoff.com/',\n docsUrl: 'https://docs.burdenoff.com/workspaces',\n githubUrl: 'https://github.com/algoshred/workspaces',\n statusPageUrl: 'https://status.burdenoff.com',\n contactEmail: 'contact@burdenoff.com',\n supportEmail: 'support@burdenoff.com',\n contactPhone: '+91-7358445777',\n contactAddress: 'Plot No.43, Veeramani Nagar, 2nd Cross Street, Nanmangalam, Chennai - 600117',\n seoTitle: 'Workspaces - Enterprise Collaboration Platform',\n seoDescription: 'The enterprise-grade foundation for collaborative digital workspaces.',\n seoKeywords: 'enterprise,collaboration,workspace,saas,multi-tenant',\n socialLinks: {\n twitter: 'https://twitter.com/burdenoff',\n github: 'https://github.com/algoshred',\n discord: 'https://discord.gg/burdenoff',\n linkedin: 'https://linkedin.com/company/burdenoff',\n },\n metadata: {\n tagline: 'The Enterprise-Grade Foundation for Collaborative Digital Workspaces',\n businessDomain: 'Enterprise Collaboration & Workspace Management',\n category: 'Core Infrastructure',\n company: 'algoshred',\n pricingRange: '$15-$125/user/month',\n },\n },\n {\n name: 'VibeControls',\n slug: 'vibecontrols',\n description: 'Developer control panel for environments, terminals, tunnels, and remote work.',\n status: 'ACTIVE',\n website: 'https://vibecontrols.com',\n appUrl: 'https://vibecontrols.local.burdenoff.com/',\n docsUrl: 'https://docs.vibecontrols.com',\n githubUrl: 'https://github.com/algoshred/vibecontrols',\n statusPageUrl: 'https://status.burdenoff.com',\n contactEmail: 'contact@vibecontrols.com',\n supportEmail: 'support@burdenoff.com',\n contactPhone: '+91-7358445777',\n contactAddress: 'Plot No.43, Veeramani Nagar, 2nd Cross Street, Nanmangalam, Chennai - 600117',\n seoTitle: 'VibeControls - Developer Environment Management',\n seoDescription: \"The Developer's Command Center for Multi-Environment Development\",\n seoKeywords: 'developer tools,environment management,terminal,remote development,devops',\n socialLinks: {\n twitter: 'https://twitter.com/burdenoff',\n github: 'https://github.com/algoshred',\n discord: 'https://discord.gg/burdenoff',\n linkedin: 'https://linkedin.com/company/burdenoff',\n },\n metadata: {\n tagline: \"The Developer's Command Center for Multi-Environment Development\",\n businessDomain: 'Developer Control Panel',\n category: 'Core Infrastructure',\n company: 'algoshred',\n pricingRange: '$25-$150/user/month',\n },\n },\n {\n name: 'FluidGrids',\n slug: 'fluidgrids',\n description:\n 'Visual workflow automation platform for building and operating complex workflows.',\n status: 'ACTIVE',\n website: 'https://fluidgrids.com',\n appUrl: 'https://fluidgrids.local.burdenoff.com/',\n docsUrl: 'https://docs.fluidgrids.com',\n githubUrl: 'https://github.com/algoshred/fluidgrids',\n statusPageUrl: 'https://status.burdenoff.com',\n contactEmail: 'contact@fluidgrids.com',\n supportEmail: 'support@burdenoff.com',\n contactPhone: '+91-7358445777',\n contactAddress: 'Plot No.43, Veeramani Nagar, 2nd Cross Street, Nanmangalam, Chennai - 600117',\n seoTitle: 'FluidGrids - Visual Workflow Automation',\n seoDescription:\n 'The Visual Automation Platform That Scales From Simple Tasks to Enterprise Workflows',\n seoKeywords: 'workflow,automation,drag-and-drop,visual,enterprise,integration,process',\n socialLinks: {\n twitter: 'https://twitter.com/burdenoff',\n github: 'https://github.com/algoshred',\n discord: 'https://discord.gg/burdenoff',\n linkedin: 'https://linkedin.com/company/burdenoff',\n },\n metadata: {\n tagline:\n 'The Visual Automation Platform That Scales From Simple Tasks to Enterprise Workflows',\n businessDomain: 'Visual Workflow Automation Platform',\n category: 'Workflow & Automation',\n company: 'algoshred',\n pricingRange: '$29-$299/user/month',\n },\n },\n {\n name: 'BigConsole',\n slug: 'bigconsole',\n description: 'AI-first dashboard and data visualization platform.',\n status: 'ACTIVE',\n website: 'https://bigconsole.com',\n appUrl: 'https://bigconsole.local.burdenoff.com/',\n docsUrl: 'https://docs.bigconsole.com',\n githubUrl: 'https://github.com/algoshred/bigconsole',\n statusPageUrl: 'https://status.burdenoff.com',\n contactEmail: 'contact@bigconsole.com',\n supportEmail: 'support@burdenoff.com',\n contactPhone: '+91-7358445777',\n contactAddress: 'Plot No.43, Veeramani Nagar, 2nd Cross Street, Nanmangalam, Chennai - 600117',\n seoTitle: 'BigConsole - AI Data Visualization Platform',\n seoDescription: 'Where Data Becomes Intelligence',\n seoKeywords: 'data visualization,business intelligence,AI,dashboard,analytics,reporting',\n socialLinks: {\n twitter: 'https://twitter.com/burdenoff',\n github: 'https://github.com/algoshred',\n discord: 'https://discord.gg/burdenoff',\n linkedin: 'https://linkedin.com/company/burdenoff',\n },\n metadata: {\n tagline: 'Where Data Becomes Intelligence',\n businessDomain: 'Data Visualization and Business Intelligence',\n category: 'AI & Intelligence',\n company: 'algoshred',\n pricingRange: '$29-$149/user/month',\n },\n },\n {\n name: 'BotManor',\n slug: 'botlit',\n description: 'Enterprise AI agent and bot automation platform.',\n status: 'ACTIVE',\n website: 'https://www.botmanor.com',\n appUrl: 'https://botlit.local.burdenoff.com/',\n docsUrl: 'https://docs.botmanor.com',\n githubUrl: 'https://github.com/algoshred/botlit',\n statusPageUrl: 'https://status.burdenoff.com',\n contactEmail: 'contact@botlit.ai',\n supportEmail: 'support@burdenoff.com',\n contactPhone: '+91-7358445777',\n contactAddress: 'Plot No.43, Veeramani Nagar, 2nd Cross Street, Nanmangalam, Chennai - 600117',\n seoTitle: 'BotManor - Enterprise AI Agent Platform',\n seoDescription:\n 'The Enterprise AI Platform That Makes Intelligent Automation Accessible to Everyone',\n seoKeywords: 'AI,bots,automation,agentic AI,intelligent automation,chatbot,enterprise AI',\n socialLinks: {\n twitter: 'https://twitter.com/burdenoff',\n github: 'https://github.com/algoshred',\n discord: 'https://discord.gg/burdenoff',\n linkedin: 'https://linkedin.com/company/burdenoff',\n },\n metadata: {\n tagline:\n 'The Enterprise AI Platform That Makes Intelligent Automation Accessible to Everyone',\n businessDomain: 'AI Platform',\n category: 'AI & Intelligence',\n company: 'algoshred',\n pricingRange: '$99-$1,999/month',\n },\n },\n];\n\ntype ProductItem = {\n id: string;\n name: string;\n slug: string;\n description: string | null | undefined;\n status: string;\n appUrl: string | null | undefined;\n activeUsers: number;\n apiCalls: number;\n contactEmail: string | null | undefined;\n createdAt: string;\n updatedAt: string;\n};\n\n/**\n * Products page — connected to real backend\n */\nexport function ProductsPage() {\n const { canViewProducts, isLoading: permissionsLoading } = useAdminPermissions();\n const apolloClient = useApolloClient();\n\n const [page, setPage] = useState(1);\n const [search, setSearch] = useState('');\n const [isSeeding, setIsSeeding] = useState(false);\n const [seedMessage, setSeedMessage] = useState<string | null>(null);\n const [seedError, setSeedError] = useState<string | null>(null);\n\n const skipQueries = permissionsLoading || !canViewProducts;\n\n const { data: statsData } = useGetPlatformProductStatsQuery({\n skip: skipQueries,\n });\n const { data, loading, error, refetch } = useListPlatformProductsQuery({\n variables: {\n filter: search ? { search } : undefined,\n limit: PAGE_SIZE,\n offset: (page - 1) * PAGE_SIZE,\n },\n fetchPolicy: 'cache-and-network',\n skip: skipQueries,\n });\n\n const products: ProductItem[] = useMemo(\n () => (data?.platformProducts?.items ?? []) as ProductItem[],\n [data]\n );\n\n const total = data?.platformProducts?.total ?? 0;\n const totalPages = Math.ceil(total / PAGE_SIZE);\n const stats = statsData?.platformProductStats;\n\n const handleSeedProducts = useCallback(async () => {\n setIsSeeding(true);\n setSeedMessage(null);\n setSeedError(null);\n\n try {\n const existingResult = await apolloClient.query<{\n platformProducts: { items: Array<{ id: string; slug: string }> };\n }>({\n query: UPSERT_PRODUCTS_QUERY,\n variables: { limit: 200, offset: 0 },\n fetchPolicy: 'network-only',\n });\n const existingProducts = existingResult.data?.platformProducts?.items ?? [];\n const existingBySlug = new Map(existingProducts.map((product) => [product.slug, product]));\n\n let created = 0;\n let updated = 0;\n for (const seed of PRODUCT_SEEDS) {\n const existing = existingBySlug.get(seed.slug);\n if (existing) {\n const input = Object.fromEntries(Object.entries(seed).filter(([key]) => key !== 'slug'));\n await apolloClient.mutate({\n mutation: UPDATE_PRODUCT_MUTATION,\n variables: { id: existing.id, input },\n });\n updated += 1;\n } else {\n await apolloClient.mutate({\n mutation: CREATE_PRODUCT_MUTATION,\n variables: { input: seed },\n });\n created += 1;\n }\n }\n\n setSeedMessage(`Seeded products: ${created} created, ${updated} updated.`);\n await refetch();\n } catch (err) {\n setSeedError(err instanceof Error ? err.message : 'Failed to seed products');\n } finally {\n setIsSeeding(false);\n }\n }, [apolloClient, refetch]);\n\n const columns = [\n {\n key: 'name',\n header: 'Product',\n render: (p: ProductItem) => (\n <div className=\"flex items-center gap-3\">\n <div className=\"min-w-0\">\n <div className=\"flex items-center gap-2\">\n <span className=\"font-medium text-text-primary\">{p.name}</span>\n {p.appUrl && (\n <a\n href={p.appUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={(e) => e.stopPropagation()}\n >\n <ExternalLink className=\"h-3 w-3 text-text-secondary hover:text-text-primary\" />\n </a>\n )}\n </div>\n <div className=\"truncate text-xs text-text-secondary\">{p.slug}</div>\n </div>\n </div>\n ),\n },\n {\n key: 'status',\n header: 'Status',\n width: '110px',\n render: (p: ProductItem) => (\n <Badge\n variant={STATUS_VARIANT[p.status as ProductStatus] ?? 'outline'}\n className=\"text-xs capitalize\"\n >\n {p.status.toLowerCase().replace('_', ' ')}\n </Badge>\n ),\n },\n {\n key: 'activeUsers',\n header: 'Users',\n width: '80px',\n align: 'right' as const,\n render: (p: ProductItem) => <span className=\"text-sm\">{p.activeUsers}</span>,\n },\n {\n key: 'updatedAt',\n header: 'Updated',\n width: '110px',\n render: (p: ProductItem) => formatDate(p.updatedAt),\n },\n ];\n\n return (\n <PermissionGuard\n allowed={canViewProducts}\n isLoading={permissionsLoading}\n pageTitle=\"Products\"\n denyMessage=\"You don't have permission to view products.\"\n >\n <PageLayout\n title=\"Products\"\n gradientWord=\"Products\"\n description={`Platform products and services${total ? ` · ${total} total` : ''}`}\n actions={\n <Button onClick={handleSeedProducts} disabled={isSeeding}>\n <Database className=\"mr-2 h-4 w-4\" />\n {isSeeding ? 'Seeding...' : 'Seed Active Products'}\n </Button>\n }\n >\n <PagePurpose className=\"mb-6\">\n Every product and service the platform offers lives here. Use this page to see which are\n live, in draft, or running a waitlist, and to seed the active product catalog — it&apos;s\n the source of truth other admin areas (billing, waitlist, referrals) point back to.\n </PagePurpose>\n\n {/* Stats */}\n {stats && (\n <MetricsGrid className=\"mb-6\">\n <MetricCard\n title=\"Total Products\"\n hero\n value={stats.total}\n icon={<Package className=\"h-5 w-5\" />}\n />\n <MetricCard title=\"Active\" value={stats.active} icon={<Server className=\"h-5 w-5\" />} />\n <MetricCard\n title=\"Waitlist\"\n value={stats.waitlist}\n icon={<Package className=\"h-5 w-5\" />}\n />\n <MetricCard title=\"Draft\" value={stats.draft} icon={<Package className=\"h-5 w-5\" />} />\n </MetricsGrid>\n )}\n\n <div className=\"space-y-4\">\n <div className=\"relative max-w-sm\">\n <Search className=\"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary\" />\n <Input\n placeholder=\"Search products...\"\n value={search}\n onChange={(e) => {\n setPage(1);\n setSearch(e.target.value);\n }}\n className=\"pl-9\"\n />\n </div>\n\n {error && (\n <div className=\"rounded-md border border-status-error-border/50 bg-status-error-bg/10 p-4 text-sm text-status-error-text\">\n Failed to load products: {error.message}\n </div>\n )}\n {seedMessage && (\n <div className=\"rounded-md border border-border-subtle bg-bg-sunken p-4 text-sm text-text-primary\">\n {seedMessage}\n </div>\n )}\n {seedError && (\n <div className=\"rounded-md border border-status-error-border/50 bg-status-error-bg/10 p-4 text-sm text-status-error-text\">\n {seedError}\n </div>\n )}\n\n <DataTable\n columns={columns}\n data={products}\n keyExtractor={(p) => p.id}\n loading={loading}\n emptyState={\n <EmptyState\n illustration=\"empty-search\"\n icon={<Package className=\"h-8 w-8\" />}\n title=\"No products found\"\n description=\"No platform products match your search\"\n />\n }\n />\n\n {total > PAGE_SIZE && (\n <Pagination\n page={page}\n totalPages={totalPages}\n totalItems={total}\n pageSize={PAGE_SIZE}\n onPageChange={setPage}\n />\n )}\n </div>\n </PageLayout>\n </PermissionGuard>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAwBA,IAAM,IAAY,IAIZ,IAA6F;CACj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Y,CAAA,EAC9D,EAAE,UACD,kBAAC,KAAD;aACE,MAAM,EAAE;aACR,QAAO;aACP,KAAI;aACJ,UAAU,MAAM,EAAE,iBAAiB;uBAEnC,kBAAC,IAAD,EAAc,WAAU,uDAAwD,CAAA;aAC9E,CAAA,CAEF;eACN,kBAAC,OAAD;YAAK,WAAU;sBAAwC,EAAE;YAAW,CAAA,CAChE;;UACF,CAAA;SAET;QACD;SACE,KAAK;SACL,QAAQ;SACR,OAAO;SACP,SAAS,MACP,kBAAC,GAAD;UACE,SAAS,EAAe,EAAE,WAA4B;UACtD,WAAU;oBAET,EAAE,OAAO,aAAa,CAAC,QAAQ,KAAK,IAAI;UACnC,CAAA;SAEX;QACD;SACE,KAAK;SACL,QAAQ;SACR,OAAO;SACP,OAAO;SACP,SAAS,MAAmB,kBAAC,QAAD;UAAM,WAAU;oBAAW,EAAE;UAAmB,CAAA;SAC7E;QACD;SACE,KAAK;SACL,QAAQ;SACR,OAAO;SACP,SAAS,MAAmB,EAAW,EAAE,UAAU;SACpD;QACF;OA6ES,MAAM;OACN,eAAe,MAAM,EAAE;OACd;OACT,YACE,kBAAC,GAAD;QACE,cAAa;QACb,MAAM,kBAAC,GAAD,EAAS,WAAU,WAAY,CAAA;QACrC,OAAM;QACN,aAAY;QACZ,CAAA;OAEJ,CAAA;MAED,IAAQ,KACP,kBAAC,GAAD;OACQ;OACM;OACZ,YAAY;OACZ,UAAU;OACV,cAAc;OACd,CAAA;MAEA;;IACK;;EACG,CAAA"}
@@ -15,11 +15,7 @@ var o = [
15
15
  allowSignup: e().default(!0),
16
16
  ssoEnabled: e().default(!1),
17
17
  mfaRequired: e().default(!1),
18
- dataRetentionDays: r().int().min(30).max(3650).default(365),
19
- customBranding: i({
20
- primaryColor: a().regex(/^#[0-9A-Fa-f]{6}$/, "Invalid hex color"),
21
- logoUrl: a().url().optional()
22
- }).optional()
18
+ dataRetentionDays: r().int().min(30).max(3650).default(365)
23
19
  }), d = i({
24
20
  name: a().min(2, "Name must be at least 2 characters").max(100, "Name must be less than 100 characters"),
25
21
  slug: a().min(2, "Slug must be at least 2 characters").max(50, "Slug must be less than 50 characters").regex(/^[a-z0-9-]+$/, "Slug can only contain lowercase letters, numbers, and hyphens"),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/admin/schemas/index.ts"],"sourcesContent":["import { z } from 'zod';\n\n// ============================================================================\n// Tenant Schemas\n// ============================================================================\n\n// Known status values the UI offers as picker options. The schema accepts\n// any non-empty string so a tenant carrying a backend-introduced status\n// (e.g. 'deleted', 'trial', 'provisioning' — see mappers.ts) can flow\n// through the edit form without the form silently rewriting it. Validation\n// of \"is this a real status\" lives at the backend, not the form.\nexport const TENANT_STATUS_VALUES = ['active', 'suspended', 'pending', 'churned'] as const;\nexport const tenantStatusSchema = z.string();\nexport type TenantStatus = (typeof TENANT_STATUS_VALUES)[number];\n\nexport const TENANT_PLAN_VALUES = [\n 'Free',\n 'Starter',\n 'Professional',\n 'Enterprise',\n 'Custom',\n] as const;\nexport const tenantPlanSchema = z.string();\nexport type TenantPlan = (typeof TENANT_PLAN_VALUES)[number];\n\nexport const tenantSettingsSchema = z.object({\n allowSignup: z.boolean().default(true),\n ssoEnabled: z.boolean().default(false),\n mfaRequired: z.boolean().default(false),\n dataRetentionDays: z.number().int().min(30).max(3650).default(365),\n customBranding: z\n .object({\n primaryColor: z.string().regex(/^#[0-9A-Fa-f]{6}$/, 'Invalid hex color'),\n logoUrl: z.string().url().optional(),\n })\n .optional(),\n});\n\nexport const createTenantSchema = z.object({\n name: z\n .string()\n .min(2, 'Name must be at least 2 characters')\n .max(100, 'Name must be less than 100 characters'),\n slug: z\n .string()\n .min(2, 'Slug must be at least 2 characters')\n .max(50, 'Slug must be less than 50 characters')\n .regex(/^[a-z0-9-]+$/, 'Slug can only contain lowercase letters, numbers, and hyphens'),\n domain: z.string().optional(),\n ownerEmail: z.string().email('Invalid email address'),\n billingEmail: z.string().email('Invalid email address').optional(),\n plan: tenantPlanSchema.default('Free'),\n settings: tenantSettingsSchema.optional(),\n});\n\nexport type CreateTenantInput = z.infer<typeof createTenantSchema>;\n\nexport const updateTenantSchema = createTenantSchema.partial().extend({\n id: z.string(),\n status: tenantStatusSchema.optional(),\n});\n\nexport type UpdateTenantInput = z.infer<typeof updateTenantSchema>;\n\n// ============================================================================\n// User Schemas\n// ============================================================================\n\nexport const userStatusSchema = z.enum(['active', 'inactive', 'pending', 'suspended']);\nexport type UserStatus = z.infer<typeof userStatusSchema>;\n\nexport const userRoleSchema = z.enum(['admin', 'member', 'viewer', 'owner']);\nexport type UserRole = z.infer<typeof userRoleSchema>;\n\nexport const createUserSchema = z.object({\n email: z.string().email('Invalid email address'),\n firstName: z\n .string()\n .min(1, 'First name is required')\n .max(50, 'First name must be less than 50 characters'),\n lastName: z\n .string()\n .min(1, 'Last name is required')\n .max(50, 'Last name must be less than 50 characters'),\n role: userRoleSchema.default('member'),\n tenantId: z.string().optional(),\n sendInvite: z.boolean().default(true),\n});\n\nexport type CreateUserInput = z.infer<typeof createUserSchema>;\n\nexport const updateUserSchema = createUserSchema.partial().extend({\n id: z.string(),\n status: userStatusSchema.optional(),\n});\n\nexport type UpdateUserInput = z.infer<typeof updateUserSchema>;\n\n// ============================================================================\n// Subscription Schemas\n// ============================================================================\n\nexport const subscriptionStatusSchema = z.enum([\n 'active',\n 'cancelled',\n 'past_due',\n 'trialing',\n 'paused',\n]);\nexport type SubscriptionStatus = z.infer<typeof subscriptionStatusSchema>;\n\nexport const billingCycleSchema = z.enum(['monthly', 'yearly']);\nexport type BillingCycle = z.infer<typeof billingCycleSchema>;\n\nexport const createSubscriptionSchema = z.object({\n tenantId: z.string().min(1, 'Tenant is required'),\n plan: tenantPlanSchema,\n billingCycle: billingCycleSchema.default('monthly'),\n seats: z.number().int().min(1, 'At least 1 seat is required').default(1),\n startDate: z.string().optional(),\n trialEndDate: z.string().optional(),\n});\n\nexport type CreateSubscriptionInput = z.infer<typeof createSubscriptionSchema>;\n\nexport const updateSubscriptionSchema = createSubscriptionSchema.partial().extend({\n id: z.string(),\n status: subscriptionStatusSchema.optional(),\n});\n\nexport type UpdateSubscriptionInput = z.infer<typeof updateSubscriptionSchema>;\n\n// ============================================================================\n// Support Ticket Schemas\n// ============================================================================\n\nexport const ticketPrioritySchema = z.enum(['low', 'medium', 'high', 'urgent']);\nexport type TicketPriority = z.infer<typeof ticketPrioritySchema>;\n\nexport const ticketStatusSchema = z.enum(['open', 'in_progress', 'waiting', 'resolved', 'closed']);\nexport type TicketStatus = z.infer<typeof ticketStatusSchema>;\n\nexport const ticketCategorySchema = z.enum([\n 'billing',\n 'technical',\n 'account',\n 'feature_request',\n 'other',\n]);\nexport type TicketCategory = z.infer<typeof ticketCategorySchema>;\n\nexport const createTicketSchema = z.object({\n subject: z\n .string()\n .min(5, 'Subject must be at least 5 characters')\n .max(200, 'Subject must be less than 200 characters'),\n description: z\n .string()\n .min(10, 'Description must be at least 10 characters')\n .max(5000, 'Description must be less than 5000 characters'),\n category: ticketCategorySchema.default('other'),\n priority: ticketPrioritySchema.default('medium'),\n tenantId: z.string().optional(),\n userId: z.string().optional(),\n});\n\nexport type CreateTicketInput = z.infer<typeof createTicketSchema>;\n\nexport const updateTicketSchema = createTicketSchema.partial().extend({\n id: z.string(),\n status: ticketStatusSchema.optional(),\n assigneeId: z.string().optional(),\n});\n\nexport type UpdateTicketInput = z.infer<typeof updateTicketSchema>;\n\n// ============================================================================\n// Settings Schemas\n// ============================================================================\n\nexport const platformSettingsSchema = z.object({\n maintenanceMode: z.boolean().default(false),\n allowNewSignups: z.boolean().default(true),\n defaultTenantPlan: tenantPlanSchema.default('Free'),\n maxUsersPerTenant: z.number().int().min(1).max(10000).default(100),\n maxStoragePerTenant: z.number().int().min(1).default(10), // GB\n emailNotifications: z.boolean().default(true),\n slackNotifications: z.boolean().default(false),\n slackWebhookUrl: z.string().url().optional().or(z.literal('')),\n});\n\nexport type PlatformSettingsInput = z.infer<typeof platformSettingsSchema>;\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O;CACpE,IAAI,GAAU;CACd,QAAQ,EAAmB,UAAU;CACrC,YAAY,GAAU,CAAC,UAAU;CAClC,CAAC,EAQW,IAAyB,EAAS;CAC7C,iBAAiB,GAAW,CAAC,QAAQ,GAAM;CAC3C,iBAAiB,GAAW,CAAC,QAAQ,GAAK;CAC1C,mBAAmB,EAAiB,QAAQ,OAAO;CACnD,mBAAmB,GAAU,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,IAAM,CAAC,QAAQ,IAAI;CAClE,qBAAqB,GAAU,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,GAAG;CACxD,oBAAoB,GAAW,CAAC,QAAQ,GAAK;CAC7C,oBAAoB,GAAW,CAAC,QAAQ,GAAM;CAC9C,iBAAiB,GAAU,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,EAAU,GAAG,CAAC;CAC/D,CAAC"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/admin/schemas/index.ts"],"sourcesContent":["import { z } from 'zod';\n\n// ============================================================================\n// Tenant Schemas\n// ============================================================================\n\n// Known status values the UI offers as picker options. The schema accepts\n// any non-empty string so a tenant carrying a backend-introduced status\n// (e.g. 'deleted', 'trial', 'provisioning' — see mappers.ts) can flow\n// through the edit form without the form silently rewriting it. Validation\n// of \"is this a real status\" lives at the backend, not the form.\nexport const TENANT_STATUS_VALUES = ['active', 'suspended', 'pending', 'churned'] as const;\nexport const tenantStatusSchema = z.string();\nexport type TenantStatus = (typeof TENANT_STATUS_VALUES)[number];\n\nexport const TENANT_PLAN_VALUES = [\n 'Free',\n 'Starter',\n 'Professional',\n 'Enterprise',\n 'Custom',\n] as const;\nexport const tenantPlanSchema = z.string();\nexport type TenantPlan = (typeof TENANT_PLAN_VALUES)[number];\n\nexport const tenantSettingsSchema = z.object({\n allowSignup: z.boolean().default(true),\n ssoEnabled: z.boolean().default(false),\n mfaRequired: z.boolean().default(false),\n dataRetentionDays: z.number().int().min(30).max(3650).default(365),\n});\n\nexport const createTenantSchema = z.object({\n name: z\n .string()\n .min(2, 'Name must be at least 2 characters')\n .max(100, 'Name must be less than 100 characters'),\n slug: z\n .string()\n .min(2, 'Slug must be at least 2 characters')\n .max(50, 'Slug must be less than 50 characters')\n .regex(/^[a-z0-9-]+$/, 'Slug can only contain lowercase letters, numbers, and hyphens'),\n domain: z.string().optional(),\n ownerEmail: z.string().email('Invalid email address'),\n billingEmail: z.string().email('Invalid email address').optional(),\n plan: tenantPlanSchema.default('Free'),\n settings: tenantSettingsSchema.optional(),\n});\n\nexport type CreateTenantInput = z.infer<typeof createTenantSchema>;\n\nexport const updateTenantSchema = createTenantSchema.partial().extend({\n id: z.string(),\n status: tenantStatusSchema.optional(),\n});\n\nexport type UpdateTenantInput = z.infer<typeof updateTenantSchema>;\n\n// ============================================================================\n// User Schemas\n// ============================================================================\n\nexport const userStatusSchema = z.enum(['active', 'inactive', 'pending', 'suspended']);\nexport type UserStatus = z.infer<typeof userStatusSchema>;\n\nexport const userRoleSchema = z.enum(['admin', 'member', 'viewer', 'owner']);\nexport type UserRole = z.infer<typeof userRoleSchema>;\n\nexport const createUserSchema = z.object({\n email: z.string().email('Invalid email address'),\n firstName: z\n .string()\n .min(1, 'First name is required')\n .max(50, 'First name must be less than 50 characters'),\n lastName: z\n .string()\n .min(1, 'Last name is required')\n .max(50, 'Last name must be less than 50 characters'),\n role: userRoleSchema.default('member'),\n tenantId: z.string().optional(),\n sendInvite: z.boolean().default(true),\n});\n\nexport type CreateUserInput = z.infer<typeof createUserSchema>;\n\nexport const updateUserSchema = createUserSchema.partial().extend({\n id: z.string(),\n status: userStatusSchema.optional(),\n});\n\nexport type UpdateUserInput = z.infer<typeof updateUserSchema>;\n\n// ============================================================================\n// Subscription Schemas\n// ============================================================================\n\nexport const subscriptionStatusSchema = z.enum([\n 'active',\n 'cancelled',\n 'past_due',\n 'trialing',\n 'paused',\n]);\nexport type SubscriptionStatus = z.infer<typeof subscriptionStatusSchema>;\n\nexport const billingCycleSchema = z.enum(['monthly', 'yearly']);\nexport type BillingCycle = z.infer<typeof billingCycleSchema>;\n\nexport const createSubscriptionSchema = z.object({\n tenantId: z.string().min(1, 'Tenant is required'),\n plan: tenantPlanSchema,\n billingCycle: billingCycleSchema.default('monthly'),\n seats: z.number().int().min(1, 'At least 1 seat is required').default(1),\n startDate: z.string().optional(),\n trialEndDate: z.string().optional(),\n});\n\nexport type CreateSubscriptionInput = z.infer<typeof createSubscriptionSchema>;\n\nexport const updateSubscriptionSchema = createSubscriptionSchema.partial().extend({\n id: z.string(),\n status: subscriptionStatusSchema.optional(),\n});\n\nexport type UpdateSubscriptionInput = z.infer<typeof updateSubscriptionSchema>;\n\n// ============================================================================\n// Support Ticket Schemas\n// ============================================================================\n\nexport const ticketPrioritySchema = z.enum(['low', 'medium', 'high', 'urgent']);\nexport type TicketPriority = z.infer<typeof ticketPrioritySchema>;\n\nexport const ticketStatusSchema = z.enum(['open', 'in_progress', 'waiting', 'resolved', 'closed']);\nexport type TicketStatus = z.infer<typeof ticketStatusSchema>;\n\nexport const ticketCategorySchema = z.enum([\n 'billing',\n 'technical',\n 'account',\n 'feature_request',\n 'other',\n]);\nexport type TicketCategory = z.infer<typeof ticketCategorySchema>;\n\nexport const createTicketSchema = z.object({\n subject: z\n .string()\n .min(5, 'Subject must be at least 5 characters')\n .max(200, 'Subject must be less than 200 characters'),\n description: z\n .string()\n .min(10, 'Description must be at least 10 characters')\n .max(5000, 'Description must be less than 5000 characters'),\n category: ticketCategorySchema.default('other'),\n priority: ticketPrioritySchema.default('medium'),\n tenantId: z.string().optional(),\n userId: z.string().optional(),\n});\n\nexport type CreateTicketInput = z.infer<typeof createTicketSchema>;\n\nexport const updateTicketSchema = createTicketSchema.partial().extend({\n id: z.string(),\n status: ticketStatusSchema.optional(),\n assigneeId: z.string().optional(),\n});\n\nexport type UpdateTicketInput = z.infer<typeof updateTicketSchema>;\n\n// ============================================================================\n// Settings Schemas\n// ============================================================================\n\nexport const platformSettingsSchema = z.object({\n maintenanceMode: z.boolean().default(false),\n allowNewSignups: z.boolean().default(true),\n defaultTenantPlan: tenantPlanSchema.default('Free'),\n maxUsersPerTenant: z.number().int().min(1).max(10000).default(100),\n maxStoragePerTenant: z.number().int().min(1).default(10), // GB\n emailNotifications: z.boolean().default(true),\n slackNotifications: z.boolean().default(false),\n slackWebhookUrl: z.string().url().optional().or(z.literal('')),\n});\n\nexport type PlatformSettingsInput = z.infer<typeof platformSettingsSchema>;\n"],"mappings":";;AAWA,IAAa,IAAuB;CAAC;CAAU;CAAa;CAAW;CAAU,EACpE,IAAqB,GAAU,EAG/B,IAAqB;CAChC;CACA;CACA;CACA;CACA;CACD,EACY,IAAmB,GAAU,EAG7B,IAAuB,EAAS;CAC3C,aAAa,GAAW,CAAC,QAAQ,GAAK;CACtC,YAAY,GAAW,CAAC,QAAQ,GAAM;CACtC,aAAa,GAAW,CAAC,QAAQ,GAAM;CACvC,mBAAmB,GAAU,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,IAAI;CACnE,CAAC,EAEW,IAAqB,EAAS;CACzC,MAAM,GACK,CACR,IAAI,GAAG,qCAAqC,CAC5C,IAAI,KAAK,wCAAwC;CACpD,MAAM,GACK,CACR,IAAI,GAAG,qCAAqC,CAC5C,IAAI,IAAI,uCAAuC,CAC/C,MAAM,gBAAgB,gEAAgE;CACzF,QAAQ,GAAU,CAAC,UAAU;CAC7B,YAAY,GAAU,CAAC,MAAM,wBAAwB;CACrD,cAAc,GAAU,CAAC,MAAM,wBAAwB,CAAC,UAAU;CAClE,MAAM,EAAiB,QAAQ,OAAO;CACtC,UAAU,EAAqB,UAAU;CAC1C,CAAC,EAIW,IAAqB,EAAmB,SAAS,CAAC,OAAO;CACpE,IAAI,GAAU;CACd,QAAQ,EAAmB,UAAU;CACtC,CAAC,EAQW,IAAmB,EAAO;CAAC;CAAU;CAAY;CAAW;CAAY,CAAC,EAGzE,IAAiB,EAAO;CAAC;CAAS;CAA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