Skip to content

Open-source status page, incident response and uptime monitoring

10.9 KB
Raw Blame
import type {
  StatuspageComponent,
  StatuspageGroupComponent,
  StatuspageIncident,
  StatuspagePage,
  StatuspageSubscriber,
} from "./api-types";

export const MOCK_PAGES: StatuspagePage[] = [
  {
    id: "sp_page_001",
    name: "Acme Corp Status",
    page_description: "Current status and incidents for Acme Corp services",
    subdomain: "acmecorp",
    domain: "status.acmecorp.com",
    url: "https://status.acmecorp.com",
    support_url: "https://support.acmecorp.com",
    time_zone: "America/New_York",
    allow_page_subscribers: true,
    allow_email_subscribers: true,
    allow_sms_subscribers: true,
    allow_webhook_subscribers: true,
    created_at: "2024-01-15T10:00:00.000Z",
    updated_at: "2024-06-01T12:00:00.000Z",
  },
];

export const MOCK_COMPONENTS: StatuspageComponent[] = [
  {
    id: "sp_comp_001",
    page_id: "sp_page_001",
    group_id: "sp_group_001",
    name: "API Gateway",
    description: "Main API gateway for all services",
    position: 1,
    status: "operational",
    showcase: true,
    only_show_if_degraded: false,
    group: false,
    start_date: "2024-01-15",
    created_at: "2024-01-15T10:00:00.000Z",
    updated_at: "2024-06-01T12:00:00.000Z",
  },
  {
    id: "sp_comp_002",
    page_id: "sp_page_001",
    group_id: "sp_group_001",
    name: "Authentication Service",
    description: "Handles user authentication and authorization",
    position: 2,
    status: "operational",
    showcase: true,
    only_show_if_degraded: false,
    group: false,
    start_date: "2024-01-15",
    created_at: "2024-01-15T10:05:00.000Z",
    updated_at: "2024-06-01T12:00:00.000Z",
  },
  {
    id: "sp_comp_003",
    page_id: "sp_page_001",
    group_id: null,
    name: "Dashboard",
    description: "Web dashboard application",
    position: 3,
    status: "degraded_performance",
    showcase: true,
    only_show_if_degraded: false,
    group: false,
    start_date: "2024-02-01",
    created_at: "2024-02-01T08:00:00.000Z",
    updated_at: "2024-06-10T15:30:00.000Z",
  },
  {
    id: "sp_comp_004",
    page_id: "sp_page_001",
    group_id: null,
    name: "CDN",
    description: null,
    position: 4,
    status: "operational",
    showcase: true,
    only_show_if_degraded: true,
    group: false,
    start_date: null,
    created_at: "2024-03-10T09:00:00.000Z",
    updated_at: "2024-06-01T12:00:00.000Z",
  },
];

export const MOCK_COMPONENT_GROUPS: StatuspageGroupComponent[] = [
  {
    id: "sp_group_001",
    page_id: "sp_page_001",
    name: "Core Services",
    description: "Core infrastructure services",
    components: ["sp_comp_001", "sp_comp_002"],
    position: 1,
    created_at: "2024-01-15T10:00:00.000Z",
    updated_at: "2024-06-01T12:00:00.000Z",
  },
];

export const MOCK_INCIDENTS: StatuspageIncident[] = [
  {
    id: "sp_incident_001",
    page_id: "sp_page_001",
    name: "API Gateway Elevated Error Rates",
    status: "resolved",
    impact: "major",
    shortlink: "https://stspg.io/abc123",
    scheduled_for: null,
    scheduled_until: null,
    resolved_at: "2024-06-10T16:45:00.000Z",
    monitoring_at: "2024-06-10T16:00:00.000Z",
    created_at: "2024-06-10T14:00:00.000Z",
    updated_at: "2024-06-10T16:45:00.000Z",
    incident_updates: [
      {
        id: "sp_update_001",
        incident_id: "sp_incident_001",
        status: "investigating",
        body: "We are investigating elevated error rates on the API Gateway.",
        display_at: "2024-06-10T14:00:00.000Z",
        deliver_notifications: true,
        affected_components: [
          {
            code: "sp_comp_001",
            name: "API Gateway",
            old_status: "operational",
            new_status: "major_outage",
          },
        ],
        created_at: "2024-06-10T14:00:00.000Z",
        updated_at: "2024-06-10T14:00:00.000Z",
      },
      {
        id: "sp_update_002",
        incident_id: "sp_incident_001",
        status: "identified",
        body: "The issue has been identified as a misconfigured load balancer rule.",
        display_at: "2024-06-10T14:30:00.000Z",
        deliver_notifications: true,
        affected_components: [
          {
            code: "sp_comp_001",
            name: "API Gateway",
            old_status: "major_outage",
            new_status: "major_outage",
          },
        ],
        created_at: "2024-06-10T14:30:00.000Z",
        updated_at: "2024-06-10T14:30:00.000Z",
      },
      {
        id: "sp_update_003",
        incident_id: "sp_incident_001",
        status: "monitoring",
        body: "A fix has been deployed and we are monitoring the results.",
        display_at: "2024-06-10T16:00:00.000Z",
        deliver_notifications: true,
        affected_components: [
          {
            code: "sp_comp_001",
            name: "API Gateway",
            old_status: "major_outage",
            new_status: "degraded_performance",
          },
        ],
        created_at: "2024-06-10T16:00:00.000Z",
        updated_at: "2024-06-10T16:00:00.000Z",
      },
      {
        id: "sp_update_004",
        incident_id: "sp_incident_001",
        status: "resolved",
        body: "The issue has been fully resolved. Error rates are back to normal.",
        display_at: "2024-06-10T16:45:00.000Z",
        deliver_notifications: true,
        affected_components: [
          {
            code: "sp_comp_001",
            name: "API Gateway",
            old_status: "degraded_performance",
            new_status: "operational",
          },
        ],
        created_at: "2024-06-10T16:45:00.000Z",
        updated_at: "2024-06-10T16:45:00.000Z",
      },
    ],
    components: [MOCK_COMPONENTS[0]],
    postmortem_body:
      "## Summary\n\nOn June 10, 2024, our API Gateway experienced elevated error rates due to a misconfigured load balancer rule. The issue was resolved within 2 hours and 45 minutes.\n\n## Root Cause\n\nA deployment at 13:55 UTC introduced an incorrect routing rule that caused 30% of requests to fail.\n\n## Resolution\n\nThe faulty rule was reverted and a fix was deployed.",
    metadata: null,
  },
  {
    id: "sp_incident_002",
    page_id: "sp_page_001",
    name: "Dashboard Slow Response Times",
    status: "identified",
    impact: "minor",
    shortlink: "https://stspg.io/def456",
    scheduled_for: null,
    scheduled_until: null,
    resolved_at: null,
    monitoring_at: null,
    created_at: "2024-06-11T09:00:00.000Z",
    updated_at: "2024-06-11T09:45:00.000Z",
    incident_updates: [
      {
        id: "sp_update_005",
        incident_id: "sp_incident_002",
        status: "investigating",
        body: "We are investigating reports of slow response times on the Dashboard.",
        display_at: "2024-06-11T09:00:00.000Z",
        deliver_notifications: true,
        affected_components: [
          {
            code: "sp_comp_003",
            name: "Dashboard",
            old_status: "operational",
            new_status: "degraded_performance",
          },
        ],
        created_at: "2024-06-11T09:00:00.000Z",
        updated_at: "2024-06-11T09:00:00.000Z",
      },
      {
        id: "sp_update_006",
        incident_id: "sp_incident_002",
        status: "identified",
        body: "The issue has been traced to a slow database query affecting the main dashboard view.",
        display_at: "2024-06-11T09:45:00.000Z",
        deliver_notifications: true,
        affected_components: [
          {
            code: "sp_comp_003",
            name: "Dashboard",
            old_status: "degraded_performance",
            new_status: "degraded_performance",
          },
        ],
        created_at: "2024-06-11T09:45:00.000Z",
        updated_at: "2024-06-11T09:45:00.000Z",
      },
    ],
    components: [MOCK_COMPONENTS[2]],
    postmortem_body: null,
    metadata: null,
  },
  {
    id: "sp_incident_003",
    page_id: "sp_page_001",
    name: "Scheduled Database Maintenance",
    status: "scheduled",
    impact: "none",
    shortlink: "https://stspg.io/ghi789",
    scheduled_for: "2024-06-20T02:00:00.000Z",
    scheduled_until: "2024-06-20T06:00:00.000Z",
    resolved_at: null,
    monitoring_at: null,
    created_at: "2024-06-12T10:00:00.000Z",
    updated_at: "2024-06-12T10:00:00.000Z",
    incident_updates: [
      {
        id: "sp_update_007",
        incident_id: "sp_incident_003",
        status: "scheduled",
        body: "We will be performing scheduled database maintenance. Some services may experience brief interruptions.",
        display_at: "2024-06-12T10:00:00.000Z",
        deliver_notifications: true,
        affected_components: [
          {
            code: "sp_comp_001",
            name: "API Gateway",
            old_status: "operational",
            new_status: "under_maintenance",
          },
          {
            code: "sp_comp_002",
            name: "Authentication Service",
            old_status: "operational",
            new_status: "under_maintenance",
          },
        ],
        created_at: "2024-06-12T10:00:00.000Z",
        updated_at: "2024-06-12T10:00:00.000Z",
      },
    ],
    components: [MOCK_COMPONENTS[0], MOCK_COMPONENTS[1]],
    postmortem_body: null,
    metadata: null,
  },
];

export const MOCK_SUBSCRIBERS: StatuspageSubscriber[] = [
  {
    id: "sp_sub_001",
    page_id: "sp_page_001",
    mode: "email",
    email: "[email protected]",
    endpoint: null,
    phone_number: null,
    phone_country: null,
    display_phone_number: null,
    obfuscated_channel_name: null,
    workspace_name: null,
    components: null,
    quarantined_at: null,
    created_at: "2024-02-01T10:00:00.000Z",
  },
  {
    id: "sp_sub_002",
    page_id: "sp_page_001",
    mode: "email",
    email: "[email protected]",
    endpoint: null,
    phone_number: null,
    phone_country: null,
    display_phone_number: null,
    obfuscated_channel_name: null,
    workspace_name: null,
    components: ["sp_comp_001", "sp_comp_003"],
    quarantined_at: null,
    created_at: "2024-02-15T14:30:00.000Z",
  },
  {
    id: "sp_sub_003",
    page_id: "sp_page_001",
    mode: "webhook",
    email: null,
    endpoint: "https://hooks.acmecorp.com/statuspage",
    phone_number: null,
    phone_country: null,
    display_phone_number: null,
    obfuscated_channel_name: null,
    workspace_name: null,
    components: null,
    quarantined_at: null,
    created_at: "2024-03-01T09:00:00.000Z",
  },
  {
    id: "sp_sub_004",
    page_id: "sp_page_001",
    mode: "sms",
    email: null,
    endpoint: null,
    phone_number: "+15551234567",
    phone_country: "US",
    display_phone_number: "+1 (555) 123-4567",
    obfuscated_channel_name: null,
    workspace_name: null,
    components: ["sp_comp_001"],
    quarantined_at: null,
    created_at: "2024-03-10T11:00:00.000Z",
  },
  {
    id: "sp_sub_005",
    page_id: "sp_page_001",
    mode: "slack",
    email: null,
    endpoint: null,
    phone_number: null,
    phone_country: null,
    display_phone_number: null,
    obfuscated_channel_name: "#ops-alerts",
    workspace_name: "Acme Corp",
    components: null,
    quarantined_at: null,
    created_at: "2024-04-01T08:00:00.000Z",
  },
];