wwwlayermeshusa/seed-lm-pages.mjs
2026-03-10 09:54:58 +01:00

464 lines
17 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* Layer & Mesh — Page Seed Script (FIXED)
*
* FIX: All 'navy' select values replaced with 'dark'.
* The LM block configs don't include 'navy' as a valid option.
* If 'dark' doesn't work either, run discover-valid-values.mjs
* to find the correct values for your block select fields.
*
* Seeds 3 pages:
* 1. Homepage (slug: home, replaces root page)
* 2. SD-WAN (slug: sd-wan)
* 3. Contact (slug: contact)
*
* Usage:
* PAYLOAD_API_URL=http://localhost:3000 PAYLOAD_API_KEY=your_key node seed-lm-pages.mjs
*
* Notes:
* - Pages are created as DRAFTS — publish manually in admin
* - Images are intentionally omitted — attach manually post-seed
* - Run once; re-running will create duplicates (check admin first)
*/
const BASE_URL = process.env.PAYLOAD_API_URL || 'http://localhost:3000'
const API_KEY = process.env.PAYLOAD_API_KEY
if (!API_KEY) {
console.error('❌ Set PAYLOAD_API_KEY environment variable first.')
process.exit(1)
}
const headers = {
'Content-Type': 'application/json',
Authorization: `users API-Key ${API_KEY}`,
}
// ─── Helpers ──────────────────────────────────────────────────────────────────
/** Wrap a plain string into Payload Lexical richText JSON */
function richText(text) {
return {
root: {
type: 'root',
format: '',
indent: 0,
version: 1,
children: [
{
type: 'paragraph',
format: '',
indent: 0,
version: 1,
children: [{ type: 'text', text, format: 0, style: '', mode: 'normal', version: 1, detail: 0 }],
textFormat: 0,
textStyle: '',
},
],
direction: 'ltr',
},
}
}
async function createPage(data) {
const res = await fetch(`${BASE_URL}/api/pages?locale=sv`, {
method: 'POST',
headers,
body: JSON.stringify({ ...data, _status: 'draft' }),
})
const json = await res.json()
if (!res.ok) {
console.error(`❌ Failed to create "${data.title}":`, JSON.stringify(json, null, 2))
return null
}
console.log(`✅ Created: "${data.title}" (id: ${json.doc?.id}, slug: ${json.doc?.slug})`)
return json.doc
}
// ─── Page Definitions ─────────────────────────────────────────────────────────
// ── 1. HOMEPAGE ──────────────────────────────────────────────────────────────
const homepage = {
title: 'Hem',
slug: 'home',
layout: [
// Hero
{
blockType: 'lmHero',
heading: 'The Network Infrastructure Layer for Modern Business',
subheading: 'SD-WAN · Connectivity · Cloud Networking',
body: 'Layer & Mesh delivers enterprise-grade SD-WAN and connectivity solutions built for US businesses that demand performance, security, and control.',
ctaText: 'Get Started',
ctaLink: '/contact',
secondaryCtaText: 'View Solutions',
secondaryCtaLink: '/sd-wan',
theme: 'dark',
textColor: 'auto',
},
// Stats
{
blockType: 'lmStatistics',
stats: [
{ number: '99.99%', label: 'Uptime SLA' },
{ number: '<10ms', label: 'Latency' },
{ number: '24/7', label: 'NOC Support' },
{ number: '40+', label: 'PoP Locations' },
],
sectionBackground: 'dark',
numberColor: 'gradient',
},
// What we do — two-column CTA
{
blockType: 'lmCtaSideImage',
heading: 'Built for Distributed Enterprises',
body: 'Whether you\'re connecting branch offices, securing remote workers, or migrating to cloud-first infrastructure — Layer & Mesh provides the network fabric that makes it possible. Our SD-WAN platform gives you application-aware routing, zero-trust security, and full visibility from a single dashboard.',
ctaText: 'Explore SD-WAN',
ctaLink: '/sd-wan',
imagePosition: 'right',
theme: 'dark',
},
// Core services
{
blockType: 'lmServicesGrid',
heading: 'Our Solutions',
columns: '3',
services: [
{
title: 'SD-WAN',
description: 'Intelligent, application-aware wide-area networking that replaces legacy MPLS with cloud-ready overlay infrastructure.',
link: '/sd-wan',
},
{
title: 'Secure Access',
description: 'Zero-trust network access (ZTNA) and integrated firewall-as-a-service to protect every user and device, everywhere.',
link: '/contact',
},
{
title: 'Cloud Connect',
description: 'Direct, low-latency connections to AWS, Azure, and GCP — bypassing the public internet for mission-critical workloads.',
link: '/contact',
},
{
title: 'Managed WAN',
description: 'Fully managed wide-area network service with proactive monitoring, 24/7 NOC, and guaranteed SLAs.',
link: '/contact',
},
{
title: 'Connectivity',
description: 'Fiber, broadband, and LTE failover circuits — Layer & Mesh sources and manages the underlay so you don\'t have to.',
link: '/contact',
},
{
title: 'Network Analytics',
description: 'Real-time visibility, flow analysis, and AI-driven anomaly detection across your entire WAN fabric.',
link: '/contact',
},
],
},
// USP checklist
{
blockType: 'lmUspChecklist',
heading: 'Why Layer & Mesh',
items: [
{ text: 'Carrier-agnostic — works with any ISP or circuit type' },
{ text: 'Single-pane-of-glass management across all locations' },
{ text: 'Built-in security: NGFW, IDS/IPS, ZTNA in one platform' },
{ text: 'Rapid deployment — new sites live in hours, not weeks' },
{ text: 'US-based support team with dedicated account managers' },
{ text: 'Flexible commercial models: OPEX or CAPEX' },
],
checkColor: 'yellow',
sectionBackground: 'dark',
textColor: 'white',
},
// CTA banner
{
blockType: 'lmCtaBanner',
heading: 'Ready to modernize your WAN?',
subheading: 'Talk to a network architect today — no sales pressure, just expertise.',
ctaText: 'Schedule a Call',
ctaLink: '/contact',
secondaryCtaText: 'Learn About SD-WAN',
secondaryCtaLink: '/sd-wan',
sectionBackground: 'dark',
alignment: 'center',
size: 'large',
},
],
}
// ── 2. SD-WAN SERVICE PAGE ────────────────────────────────────────────────────
const sdwanPage = {
title: 'SD-WAN',
slug: 'sd-wan',
layout: [
// Hero
{
blockType: 'lmAlternateHero',
heading: 'SD-WAN That Scales With Your Business',
description: 'Replace legacy MPLS with a cloud-native, application-aware network overlay. Layer & Mesh SD-WAN gives IT teams full control and visibility across every location — from headquarters to the smallest branch.',
primaryCtaText: 'Get a Demo',
primaryCtaLink: '/contact',
secondaryCtaText: 'Download Datasheet',
secondaryCtaLink: '/contact',
sectionBackground: 'dark',
},
// What is SD-WAN
{
blockType: 'lmCtaSideImage',
heading: 'What is SD-WAN?',
body: 'Software-Defined Wide Area Networking (SD-WAN) separates the network control plane from the data plane, giving you centralized management over a distributed WAN. Unlike traditional MPLS, SD-WAN is transport-agnostic — it can run over fiber, broadband, LTE, or any combination — and routes traffic intelligently based on real-time application performance metrics.',
ctaText: 'Talk to an Expert',
ctaLink: '/contact',
imagePosition: 'left',
theme: 'dark',
},
// Key capabilities
{
blockType: 'lmCardGrid',
layout: '1-1-1',
cardStyle: 'dark',
sectionBackground: 'dark',
cards: [
{
displayMode: 'centeredHeading',
heading: 'Application-Aware Routing',
},
{
displayMode: 'centeredHeading',
heading: 'Zero-Touch Provisioning',
},
{
displayMode: 'centeredHeading',
heading: 'Integrated Security Stack',
},
{
displayMode: 'centeredHeading',
heading: 'Cloud On-Ramp',
},
{
displayMode: 'centeredHeading',
heading: 'WAN Optimization',
},
{
displayMode: 'centeredHeading',
heading: 'Real-Time Analytics',
},
],
},
// Tech properties — spec callout
{
blockType: 'lmTechProperties',
properties: [
{ category: 'Deployment Model', value: 'Cloud-Managed' },
{ category: 'Failover Time', value: '<500ms' },
{ category: 'Encryption', value: 'AES-256' },
{ category: 'Uptime SLA', value: '99.99%' },
],
sectionBackground: 'dark',
categoryColor: 'white',
valueColor: 'yellow',
},
// USP table
{
blockType: 'lmUspTable',
heading: 'SD-WAN vs. Legacy MPLS',
rows: [
{
title: 'Cost',
description: richText('SD-WAN runs over affordable broadband and LTE circuits, eliminating expensive dedicated MPLS lines. Most customers see 4070% WAN cost reduction.'),
},
{
title: 'Deployment Speed',
description: richText('Zero-touch provisioning gets new sites online in hours. MPLS circuits can take 90+ days to provision.'),
},
{
title: 'Cloud Performance',
description: richText('Direct cloud breakout routes traffic to AWS, Azure, and GCP without backhauling through the datacenter — dramatically improving SaaS application performance.'),
},
{
title: 'Visibility',
description: richText('Per-application, per-user, per-site analytics in a single dashboard. Legacy WAN provides minimal insight into traffic quality.'),
},
{
title: 'Resilience',
description: richText('Automatic failover across multiple transport paths (fiber + LTE) in under 500ms. MPLS has no built-in redundancy.'),
},
],
checkColor: 'yellow',
sectionBackground: 'dark',
textColor: 'white',
},
// Wide card — VF Standard CPE callout
{
blockType: 'lmWideCard',
heading: 'VF Standard CPE',
body: 'Our flagship SD-WAN customer premises equipment. Pre-configured, zero-touch deployable, and managed 24/7 by Layer & Mesh NOC engineers. Ships preconfigured for your network — plug it in and it comes online automatically.',
ctaText: 'Order Now',
ctaLink: '/contact',
cardBackground: 'dark',
buttonColor: 'yellow',
sectionBackground: 'dark',
},
// FAQ
{
blockType: 'lmFaq',
heading: 'SD-WAN FAQs',
items: [
{
question: 'How long does SD-WAN deployment take?',
answer: richText('New sites can be deployed in as little as 4 hours using zero-touch provisioning. The device ships pre-configured — your team just plugs it in and connects the WAN circuits. Edge cases like custom firewall policies or complex BGP configurations may take longer.'),
},
{
question: 'Can SD-WAN replace our existing MPLS?',
answer: richText('Yes. Most customers migrate in phases — we run SD-WAN alongside existing MPLS during transition, then decommission MPLS once performance is validated. Layer & Mesh manages the full migration process.'),
},
{
question: 'What happens if my internet connection goes down?',
answer: richText('Layer & Mesh SD-WAN supports active-active dual-WAN configurations. If your primary circuit fails, traffic automatically shifts to the secondary path (e.g., LTE failover) in under 500 milliseconds — most applications won\'t even notice.'),
},
{
question: 'Does SD-WAN include security features?',
answer: richText('Yes. Our platform includes an integrated next-generation firewall (NGFW), IDS/IPS, DNS filtering, and zero-trust network access (ZTNA). Security policies are managed centrally from the same dashboard as your WAN.'),
},
{
question: 'What is the contract term?',
answer: richText('We offer 12, 24, and 36-month terms. Longer terms come with pricing discounts. Month-to-month is available for qualified customers. Contact us to discuss what works for your situation.'),
},
],
theme: 'gray',
},
// CTA
{
blockType: 'lmCtaBanner',
heading: 'See SD-WAN in action',
subheading: 'Book a 30-minute technical demo with one of our network architects.',
ctaText: 'Book a Demo',
ctaLink: '/contact',
sectionBackground: 'yellow',
alignment: 'center',
size: 'medium',
},
],
}
// ── 3. CONTACT PAGE ───────────────────────────────────────────────────────────
const contactPage = {
title: 'Contact',
slug: 'contact',
layout: [
// Header
{
blockType: 'lmAlternateHero',
heading: 'Get in Touch',
description: 'Whether you\'re evaluating SD-WAN, need a quote, or want to talk architecture — our team is ready. No sales script, just honest conversation.',
sectionBackground: 'dark',
},
// Two-column: contact methods + form placeholder
{
blockType: 'lmContact',
heading: 'Reach Us Directly',
contactMethods: [
{
label: 'Sales & New Business',
link: 'mailto:sales@layermesh.com',
},
{
label: 'Technical Support',
link: 'mailto:support@layermesh.com',
},
{
label: 'General Inquiries',
link: 'mailto:hello@layermesh.com',
},
{
label: 'Call Us',
link: 'tel:+18005550100',
},
],
},
// Text block — response time expectations
{
blockType: 'lmText',
heading: 'What to Expect',
body: richText('We respond to all sales inquiries within one business day. Support tickets are triaged within 2 hours for customers on a managed plan. For urgent network issues, call our 24/7 NOC directly.'),
alignment: 'center',
textColor: 'white',
sectionBackground: 'dark',
maxWidth: 'medium',
},
// Stats — trust signals
{
blockType: 'lmStatistics',
stats: [
{ number: '< 1hr', label: 'Avg. First Response' },
{ number: '24/7', label: 'NOC Coverage' },
{ number: '98%', label: 'Customer Satisfaction' },
],
sectionBackground: 'dark',
numberColor: 'gradient',
},
// FAQ — pre-sales questions
{
blockType: 'lmFaq',
heading: 'Common Questions Before You Reach Out',
items: [
{
question: 'Do you work with small businesses?',
answer: richText('Our solutions are best suited for organizations with 3 or more locations, or distributed remote workforces. Single-site businesses may be better served by a local MSP.'),
},
{
question: 'What information should I have ready for a demo?',
answer: richText('It helps to know: number of locations, rough headcount per site, current WAN technology (MPLS, broadband, etc.), and your top 23 pain points. That\'s it — we\'ll do the rest.'),
},
{
question: 'Do you offer a free trial?',
answer: richText('We offer a 30-day proof-of-concept (PoC) for qualified enterprise customers. Contact us to discuss eligibility and scope.'),
},
{
question: 'Where are you based?',
answer: richText('Layer & Mesh is headquartered in the United States with PoP infrastructure across 40+ locations nationwide.'),
},
],
theme: 'dark',
},
],
}
// ─── Run ──────────────────────────────────────────────────────────────────────
async function run() {
console.log(`\n🚀 Seeding Layer & Mesh pages → ${BASE_URL}\n`)
await createPage(homepage)
await createPage(sdwanPage)
await createPage(contactPage)
console.log('\n✨ Done. Pages created as drafts — review and publish in /admin.')
console.log(' Remember to attach images to blocks that need them.')
}
run().catch(console.error)