Skip to content

Open-source status page, incident response and uptime monitoring

chore: @openstatus/regions package (#1448)

Maximilian Kaskec45933c75440
diff --git a/apps/dashboard/package.json b/apps/dashboard/package.json
index 4ba2e9666..b015a38d2 100644
--- a/apps/dashboard/package.json
+++ b/apps/dashboard/package.json
@@ -39,6 +39,7 @@
"@openstatus/notification-slack": "workspace:*",
"@openstatus/notification-webhook": "workspace:*",
"@openstatus/react": "workspace:*",
+ "@openstatus/regions": "workspace:*",
"@openstatus/tinybird": "workspace:*",
"@openstatus/tracker": "workspace:*",
"@openstatus/upstash": "workspace:*",
diff --git a/apps/dashboard/src/components/chart/chart-line-regions.tsx b/apps/dashboard/src/components/chart/chart-line-regions.tsx
index 2337ae679..f4e00bf28 100644
--- a/apps/dashboard/src/components/chart/chart-line-regions.tsx
+++ b/apps/dashboard/src/components/chart/chart-line-regions.tsx
@@ -14,7 +14,7 @@ import { regionColors } from "@/data/regions";
import { useIsMobile } from "@/hooks/use-mobile";
import { cn } from "@/lib/utils";
import { monitorRegions } from "@openstatus/db/src/schema/constants";
-import { regionDict } from "@openstatus/utils";
+import { regionDict } from "@openstatus/regions";
import { ChartTooltipNumber } from "./chart-tooltip-number";
const chartConfig = monitorRegions.reduce((config, region) => {
diff --git a/apps/dashboard/src/components/controls-search/command-region.tsx b/apps/dashboard/src/components/controls-search/command-region.tsx
index ff327dec3..7fc910c9c 100644
--- a/apps/dashboard/src/components/controls-search/command-region.tsx
+++ b/apps/dashboard/src/components/controls-search/command-region.tsx
@@ -25,7 +25,7 @@ import {
import { REGIONS } from "@/data/metrics.client";
import { useTRPC } from "@/lib/trpc/client";
import { cn } from "@/lib/utils";
-import { formatRegionCode, groupByContinent } from "@openstatus/utils";
+import { formatRegionCode, groupByContinent } from "@openstatus/regions";
import { useQuery } from "@tanstack/react-query";
import { Check, Lock } from "lucide-react";
import { parseAsArrayOf, parseAsStringLiteral, useQueryState } from "nuqs";
diff --git a/apps/dashboard/src/components/data-table/response-logs/columns.tsx b/apps/dashboard/src/components/data-table/response-logs/columns.tsx
index ef5f397c3..9b8e5c80e 100644
--- a/apps/dashboard/src/components/data-table/response-logs/columns.tsx
+++ b/apps/dashboard/src/components/data-table/response-logs/columns.tsx
@@ -17,7 +17,7 @@ import {
import { getStatusCodeVariant, textColors } from "@/data/status-codes";
import { cn } from "@/lib/utils";
import type { RouterOutputs } from "@openstatus/api";
-import { regionDict } from "@openstatus/utils";
+import { regionDict } from "@openstatus/regions";
import { HoverCardPortal } from "@radix-ui/react-hover-card";
import type { ColumnDef } from "@tanstack/react-table";
import { Clock, Workflow } from "lucide-react";
diff --git a/apps/dashboard/src/components/data-table/response-logs/data-table-basics.tsx b/apps/dashboard/src/components/data-table/response-logs/data-table-basics.tsx
index 894c42cd3..b6b2382e2 100644
--- a/apps/dashboard/src/components/data-table/response-logs/data-table-basics.tsx
+++ b/apps/dashboard/src/components/data-table/response-logs/data-table-basics.tsx
@@ -16,7 +16,7 @@ import { getStatusCodeVariant, textColors } from "@/data/status-codes";
import { formatMilliseconds, formatPercentage } from "@/lib/formatter";
import { cn } from "@/lib/utils";
import type { RouterOutputs } from "@openstatus/api";
-import { regionDict } from "@openstatus/utils";
+import { regionDict } from "@openstatus/regions";
import { Braces, TableProperties } from "lucide-react";
type ResponseLog = RouterOutputs["tinybird"]["get"]["data"][number];
diff --git a/apps/dashboard/src/components/data-table/response-logs/regions/columns.tsx b/apps/dashboard/src/components/data-table/response-logs/regions/columns.tsx
index e293011ea..028d0e4da 100644
--- a/apps/dashboard/src/components/data-table/response-logs/regions/columns.tsx
+++ b/apps/dashboard/src/components/data-table/response-logs/regions/columns.tsx
@@ -12,7 +12,7 @@ import {
} from "@/components/ui/tooltip";
import type { RegionMetric } from "@/data/region-metrics";
import { getActions } from "@/data/region-metrics.client";
-import { formatRegionCode, regionDict } from "@openstatus/utils";
+import { formatRegionCode, regionDict } from "@openstatus/regions";
import type { ColumnDef } from "@tanstack/react-table";
// import { toast } from "sonner";
import { useRouter } from "next/navigation";
diff --git a/apps/dashboard/src/components/forms/monitor/form-scheduling-regions.tsx b/apps/dashboard/src/components/forms/monitor/form-scheduling-regions.tsx
index ceeed9eb9..3d69f495e 100644
--- a/apps/dashboard/src/components/forms/monitor/form-scheduling-regions.tsx
+++ b/apps/dashboard/src/components/forms/monitor/form-scheduling-regions.tsx
@@ -47,7 +47,7 @@ import {
formatRegionCode,
groupByContinent,
regionDict,
-} from "@openstatus/utils";
+} from "@openstatus/regions";
import { useQuery } from "@tanstack/react-query";
import { isTRPCClientError } from "@trpc/client";
import { CircleX, Info } from "lucide-react";
diff --git a/apps/server/package.json b/apps/server/package.json
index 5d87878c7..00bfe9c3b 100644
--- a/apps/server/package.json
+++ b/apps/server/package.json
@@ -20,6 +20,7 @@
"@openstatus/db": "workspace:*",
"@openstatus/emails": "workspace:*",
"@openstatus/error": "workspace:*",
+ "@openstatus/regions": "workspace:*",
"@openstatus/tinybird": "workspace:*",
"@openstatus/tracker": "workspace:*",
"@openstatus/upstash": "workspace:*",
diff --git a/apps/server/src/routes/v1/monitors/schema.ts b/apps/server/src/routes/v1/monitors/schema.ts
index 02b209876..249fdf6f2 100644
--- a/apps/server/src/routes/v1/monitors/schema.ts
+++ b/apps/server/src/routes/v1/monitors/schema.ts
@@ -6,7 +6,7 @@ import {
monitorPeriodicitySchema,
monitorRegions,
} from "@openstatus/db/src/schema/constants";
-import { regionDict } from "@openstatus/utils";
+import { AVAILABLE_REGIONS } from "@openstatus/regions";
import { ZodError } from "zod";
const statusAssertion = z
@@ -105,10 +105,9 @@ export const MonitorSchema = z
}
const deprecatedRegions = regions.filter((r) => {
- const deprecated =
- regionDict[r as keyof typeof regionDict].deprecated;
- if (deprecated) return true;
- return false;
+ return !AVAILABLE_REGIONS.includes(
+ r as (typeof AVAILABLE_REGIONS)[number],
+ );
});
if (deprecatedRegions.length > 0) {
@@ -372,10 +371,9 @@ const baseRequest = z.object({
}
const deprecatedRegions = regions.filter((r) => {
- const deprecated =
- regionDict[r as keyof typeof regionDict].deprecated;
- if (deprecated) return true;
- return false;
+ return !AVAILABLE_REGIONS.includes(
+ r as (typeof AVAILABLE_REGIONS)[number],
+ );
});
if (deprecatedRegions.length > 0) {
diff --git a/apps/web/package.json b/apps/web/package.json
index d9b6bb856..882cfe047 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -33,6 +33,7 @@
"@openstatus/notification-slack": "workspace:*",
"@openstatus/notification-webhook": "workspace:*",
"@openstatus/react": "workspace:*",
+ "@openstatus/regions": "workspace:*",
"@openstatus/tinybird": "workspace:*",
"@openstatus/tracker": "workspace:*",
"@openstatus/ui": "workspace:*",
diff --git a/apps/web/src/app/(pages)/(content)/play/checker/_components/checker-form.tsx b/apps/web/src/app/(pages)/(content)/play/checker/_components/checker-form.tsx
index 731a0bc24..d3c7c470c 100644
--- a/apps/web/src/app/(pages)/(content)/play/checker/_components/checker-form.tsx
+++ b/apps/web/src/app/(pages)/(content)/play/checker/_components/checker-form.tsx
@@ -46,7 +46,7 @@ import {
import { toast } from "@/lib/toast";
import { notEmpty } from "@/lib/utils";
import { monitorRegions } from "@openstatus/db/src/schema/constants";
-import { regionDict } from "@openstatus/utils";
+import { regionDict } from "@openstatus/regions";
import { ArrowRight, ChevronRight, Gauge, Info, Loader } from "lucide-react";
import dynamic from "next/dynamic";
import Link from "next/link";
diff --git a/apps/web/src/app/(pages)/(content)/play/checker/_components/global-monitoring.tsx b/apps/web/src/app/(pages)/(content)/play/checker/_components/global-monitoring.tsx
index de745632e..4a0cef33e 100644
--- a/apps/web/src/app/(pages)/(content)/play/checker/_components/global-monitoring.tsx
+++ b/apps/web/src/app/(pages)/(content)/play/checker/_components/global-monitoring.tsx
@@ -10,7 +10,7 @@ import {
CardIcon,
CardTitle,
} from "@/components/marketing/card";
-import { regionDict } from "@openstatus/utils";
+import { regionDict } from "@openstatus/regions";
const TOTAL_REGIONS = Object.keys(regionDict).length;
diff --git a/apps/web/src/app/(pages)/(content)/play/checker/_components/informations.tsx b/apps/web/src/app/(pages)/(content)/play/checker/_components/informations.tsx
index fbb71cb94..2d4d9cb1b 100644
--- a/apps/web/src/app/(pages)/(content)/play/checker/_components/informations.tsx
+++ b/apps/web/src/app/(pages)/(content)/play/checker/_components/informations.tsx
@@ -1,6 +1,6 @@
import { Shell } from "@/components/dashboard/shell";
+import { regionDict } from "@openstatus/regions";
import { Separator } from "@openstatus/ui";
-import { regionDict } from "@openstatus/utils";
const TOTAL_REGIONS = Object.keys(regionDict).length;
const TOTAL_PROVIDERS = Object.keys(regionDict).reduce((acc, region) => {
diff --git a/apps/web/src/app/api/checker/cron/_cron.ts b/apps/web/src/app/api/checker/cron/_cron.ts
index 7b3690c48..4db0fe0f4 100644
--- a/apps/web/src/app/api/checker/cron/_cron.ts
+++ b/apps/web/src/app/api/checker/cron/_cron.ts
@@ -16,12 +16,12 @@ import {
import { env } from "@/env";
import type { Region } from "@openstatus/db/src/schema/constants";
+import { regionDict } from "@openstatus/regions";
import {
type httpPayloadSchema,
type tpcPayloadSchema,
transformHeaders,
} from "@openstatus/utils";
-import { regionDict } from "@openstatus/utils";
const periodicityAvailable = selectMonitorSchema.pick({ periodicity: true });
@@ -263,7 +263,10 @@ const createCronTask = async ({
function generateUrl({
row,
region,
-}: { row: z.infer<typeof selectMonitorSchema>; region: Region }) {
+}: {
+ row: z.infer<typeof selectMonitorSchema>;
+ region: Region;
+}) {
const regionInfo = regionDict[region];
switch (regionInfo.provider) {
diff --git a/apps/web/src/components/data-table/columns.tsx b/apps/web/src/components/data-table/columns.tsx
index dc3098b37..2c87490b4 100644
--- a/apps/web/src/components/data-table/columns.tsx
+++ b/apps/web/src/components/data-table/columns.tsx
@@ -4,7 +4,7 @@ import type { ColumnDef } from "@tanstack/react-table";
import { format } from "date-fns";
import type * as z from "zod";
-import { regionDict } from "@openstatus/utils";
+import { regionDict } from "@openstatus/regions";
import type { Trigger } from "@/lib/monitor/utils";
import type { monitorRegionSchema } from "@openstatus/db/src/schema/constants";
diff --git a/apps/web/src/components/data-table/data-table-toolbar.tsx b/apps/web/src/components/data-table/data-table-toolbar.tsx
index 68d95d58f..9ae12e6e4 100644
--- a/apps/web/src/components/data-table/data-table-toolbar.tsx
+++ b/apps/web/src/components/data-table/data-table-toolbar.tsx
@@ -4,8 +4,8 @@ import type { Table } from "@tanstack/react-table";
import { X } from "lucide-react";
import { useRouter, useSearchParams } from "next/navigation";
+import { regionDict } from "@openstatus/regions";
import { Button } from "@openstatus/ui/src/components/button";
-import { regionDict } from "@openstatus/utils";
import { Icons } from "@/components/icons";
import { codesDict } from "@/data/code-dictionary";
diff --git a/apps/web/src/components/data-table/single-region/columns.tsx b/apps/web/src/components/data-table/single-region/columns.tsx
index 93b72eb40..90b35f841 100644
--- a/apps/web/src/components/data-table/single-region/columns.tsx
+++ b/apps/web/src/components/data-table/single-region/columns.tsx
@@ -4,7 +4,7 @@ import { SimpleChart } from "@/components/monitor-charts/simple-chart";
import { formatNumber } from "@/components/monitor-dashboard/metrics-card";
import type { ResponseTimeMetricsByRegion } from "@/lib/tb";
import type { Region } from "@openstatus/db/src/schema/constants";
-import { regionDict } from "@openstatus/utils";
+import { regionDict } from "@openstatus/regions";
import type { ColumnDef } from "@tanstack/react-table";
import { DataTableColumnHeader } from "./data-table-column-header";
diff --git a/apps/web/src/components/forms/monitor/request-test-button.tsx b/apps/web/src/components/forms/monitor/request-test-button.tsx
index dc7e4ea6d..889800f9d 100644
--- a/apps/web/src/components/forms/monitor/request-test-button.tsx
+++ b/apps/web/src/components/forms/monitor/request-test-button.tsx
@@ -10,6 +10,7 @@ import {
type Region,
monitorRegions,
} from "@openstatus/db/src/schema/constants";
+import { regionDict } from "@openstatus/regions";
import {
Button,
Dialog,
@@ -26,7 +27,6 @@ import {
TooltipProvider,
TooltipTrigger,
} from "@openstatus/ui";
-import { regionDict } from "@openstatus/utils";
import { LoadingAnimation } from "@/components/loading-animation";
import { RegionInfo } from "@/components/ping-response-analysis/region-info";
diff --git a/apps/web/src/components/forms/monitor/section-scheduling.tsx b/apps/web/src/components/forms/monitor/section-scheduling.tsx
index b6faa73ff..8d28b9a1e 100644
--- a/apps/web/src/components/forms/monitor/section-scheduling.tsx
+++ b/apps/web/src/components/forms/monitor/section-scheduling.tsx
@@ -9,6 +9,7 @@ import type { Limits } from "@openstatus/db/src/schema/plan/schema";
import { getLimit } from "@openstatus/db/src/schema/plan/utils";
import { cn } from "@/lib/utils";
+import { groupByContinent } from "@openstatus/regions";
import {
FormControl,
FormDescription,
@@ -22,7 +23,6 @@ import {
SelectTrigger,
SelectValue,
} from "@openstatus/ui";
-import { groupByContinent } from "@openstatus/utils";
import { CheckboxLabel } from "../shared/checkbox-label";
import { SectionHeader } from "../shared/section-header";
diff --git a/apps/web/src/components/forms/monitor/select-region.tsx b/apps/web/src/components/forms/monitor/select-region.tsx
index 197d5a8d1..8cfee7b14 100644
--- a/apps/web/src/components/forms/monitor/select-region.tsx
+++ b/apps/web/src/components/forms/monitor/select-region.tsx
@@ -2,6 +2,12 @@
import { Check, ChevronsUpDown, Globe2 } from "lucide-react";
+import {
+ type Continent,
+ type RegionInfo,
+ formatRegionCode,
+ regionDict,
+} from "@openstatus/regions";
import { Button, type ButtonProps } from "@openstatus/ui/src/components/button";
import {
Command,
@@ -17,12 +23,6 @@ import {
PopoverContent,
PopoverTrigger,
} from "@openstatus/ui/src/components/popover";
-import {
- type Continent,
- type RegionInfo,
- formatRegionCode,
- regionDict,
-} from "@openstatus/utils";
import { cn } from "@/lib/utils";
import {
diff --git a/apps/web/src/components/monitor-charts/region-table.tsx b/apps/web/src/components/monitor-charts/region-table.tsx
index fba655ae9..e7b7f4938 100644
--- a/apps/web/src/components/monitor-charts/region-table.tsx
+++ b/apps/web/src/components/monitor-charts/region-table.tsx
@@ -1,3 +1,4 @@
+import { regionDict } from "@openstatus/regions";
import {
Table,
TableBody,
@@ -7,7 +8,6 @@ import {
TableHeader,
TableRow,
} from "@openstatus/ui/src/components/table";
-import { regionDict } from "@openstatus/utils";
import { formatNumber } from "@/components/monitor-dashboard/metrics-card";
import type { ResponseTimeMetricsByRegion } from "@/lib/tb";
diff --git a/apps/web/src/components/monitor-charts/utils.tsx b/apps/web/src/components/monitor-charts/utils.tsx
index 920e41fd3..ec8f54e06 100644
--- a/apps/web/src/components/monitor-charts/utils.tsx
+++ b/apps/web/src/components/monitor-charts/utils.tsx
@@ -1,4 +1,4 @@
-import { regionDict } from "@openstatus/utils";
+import { regionDict } from "@openstatus/regions";
import type { Period, Quantile } from "@/lib/monitor/utils";
import type { ResponseGraph } from "@/lib/tb";
diff --git a/apps/web/src/components/monitor-dashboard/region-preset.tsx b/apps/web/src/components/monitor-dashboard/region-preset.tsx
index 5bab8f011..e72d682e7 100644
--- a/apps/web/src/components/monitor-dashboard/region-preset.tsx
+++ b/apps/web/src/components/monitor-dashboard/region-preset.tsx
@@ -2,6 +2,12 @@
import { Check, ChevronsUpDown, Globe2 } from "lucide-react";
+import {
+ type Continent,
+ type RegionInfo,
+ formatRegionCode,
+ regionDict,
+} from "@openstatus/regions";
import { Button, type ButtonProps } from "@openstatus/ui/src/components/button";
import {
Command,
@@ -17,12 +23,6 @@ import {
PopoverContent,
PopoverTrigger,
} from "@openstatus/ui/src/components/popover";
-import {
- type Continent,
- type RegionInfo,
- formatRegionCode,
- regionDict,
-} from "@openstatus/utils";
import { IconCloudProvider } from "@/components/icon-cloud-provider";
import { cn } from "@/lib/utils";
diff --git a/apps/web/src/components/ping-response-analysis/columns.tsx b/apps/web/src/components/ping-response-analysis/columns.tsx
index 17d9ab3f8..20192ca11 100644
--- a/apps/web/src/components/ping-response-analysis/columns.tsx
+++ b/apps/web/src/components/ping-response-analysis/columns.tsx
@@ -6,13 +6,13 @@ import { type RegionChecker, latencyFormatter, regionFormatter } from "./utils";
import { DataTableColumnHeader } from "@/components/data-table/data-table-column-header";
import { IconCloudProviderTooltip } from "@/components/icon-cloud-provider";
import { cn } from "@/lib/utils";
+import { formatRegionCode, regionDict } from "@openstatus/regions";
import {
HoverCard,
HoverCardContent,
HoverCardPortal,
HoverCardTrigger,
} from "@openstatus/ui";
-import { formatRegionCode, regionDict } from "@openstatus/utils";
export const columns: ColumnDef<RegionChecker>[] = [
{
diff --git a/apps/web/src/components/ping-response-analysis/multi-region-chart.tsx b/apps/web/src/components/ping-response-analysis/multi-region-chart.tsx
index 79a483da7..4b844a86e 100644
--- a/apps/web/src/components/ping-response-analysis/multi-region-chart.tsx
+++ b/apps/web/src/components/ping-response-analysis/multi-region-chart.tsx
@@ -6,6 +6,7 @@ import { getTimingPhases, regionFormatter } from "./utils";
import { Bar, BarChart, CartesianGrid, XAxis } from "recharts";
import { IconCloudProvider } from "@/components/icon-cloud-provider";
+import { formatRegionCode, regionDict } from "@openstatus/regions";
import {
type ChartConfig,
ChartContainer,
@@ -14,7 +15,6 @@ import {
ChartTooltip,
ChartTooltipContent,
} from "@openstatus/ui/src/components/chart";
-import { formatRegionCode, regionDict } from "@openstatus/utils";
const chartConfig = {
dns: {
diff --git a/apps/web/src/components/ping-response-analysis/utils.ts b/apps/web/src/components/ping-response-analysis/utils.ts
index 969f9a00f..5e8dce177 100644
--- a/apps/web/src/components/ping-response-analysis/utils.ts
+++ b/apps/web/src/components/ping-response-analysis/utils.ts
@@ -6,7 +6,7 @@ import {
monitorRegionSchema,
} from "@openstatus/db/src/schema/constants";
import type { Region } from "@openstatus/db/src/schema/constants";
-import { continentDict, regionDict } from "@openstatus/utils";
+import { continentDict, regionDict } from "@openstatus/regions";
export function latencyFormatter(value: number) {
return `${new Intl.NumberFormat("us").format(value).toString()}ms`;
diff --git a/apps/web/src/config/alternatives.ts b/apps/web/src/config/alternatives.ts
index 515fe7d0c..6567d72ac 100644
--- a/apps/web/src/config/alternatives.ts
+++ b/apps/web/src/config/alternatives.ts
@@ -45,6 +45,7 @@ export const alternativesConfig = {
features: [
opensource(),
bootstrap(),
+ multicloud(),
global(),
otelexport(),
githubaction(),
@@ -58,6 +59,7 @@ export const alternativesConfig = {
logo: "/assets/alternatives/uptime-kuma.png",
features: [
opensource(true),
+ multicloud(),
global(),
selfhost(),
managed(),
@@ -103,7 +105,7 @@ function bootstrap(alternative = false): Feature {
function global(alternative = false): Feature {
return {
- label: "Global (35 regions)",
+ label: "Global (28 regions)",
description: "Monitor your endpoints globally.",
openstatus: true,
alternative,
@@ -114,7 +116,16 @@ function multiregion(alternative = 1): Feature {
return {
label: "Multi-region",
description: "Monitor your endpoints globally",
- openstatus: 35,
+ openstatus: 28,
+ alternative,
+ };
+}
+
+function multicloud(alternative = undefined): Feature {
+ return {
+ label: "Multi-cloud",
+ description: "Monitor from different cloud providers",
+ openstatus: 3,
alternative,
};
}
diff --git a/packages/api/package.json b/packages/api/package.json
index 3af593000..1887127d5 100644
--- a/packages/api/package.json
+++ b/packages/api/package.json
@@ -13,6 +13,7 @@
"@openstatus/db": "workspace:*",
"@openstatus/emails": "workspace:*",
"@openstatus/error": "workspace:*",
+ "@openstatus/regions": "workspace:*",
"@openstatus/utils": "workspace:*",
"@openstatus/upstash": "workspace:*",
"@openstatus/tinybird": "workspace:*",
diff --git a/packages/api/src/router/monitor.ts b/packages/api/src/router/monitor.ts
index e368c4f42..b767bd978 100644
--- a/packages/api/src/router/monitor.ts
+++ b/packages/api/src/router/monitor.ts
@@ -41,7 +41,7 @@ import {
monitorPeriodicity,
monitorRegions,
} from "@openstatus/db/src/schema/constants";
-import { regionDict } from "@openstatus/utils";
+import { regionDict } from "@openstatus/regions";
import { createTRPCRouter, protectedProcedure, publicProcedure } from "../trpc";
import { testHttp, testTcp } from "./checker";
diff --git a/packages/db/package.json b/packages/db/package.json
index a9dc40c9c..a6339ad1b 100644
--- a/packages/db/package.json
+++ b/packages/db/package.json
@@ -14,13 +14,14 @@
},
"dependencies": {
"@libsql/client": "0.15.14",
+ "@openstatus/assertions": "workspace:*",
+ "@openstatus/regions": "workspace:*",
"@t3-oss/env-core": "0.7.1",
"drizzle-orm": "0.44.4",
"drizzle-zod": "0.5.1",
"zod": "3.24.2"
},
"devDependencies": {
- "@openstatus/assertions": "workspace:*",
"@openstatus/tsconfig": "workspace:*",
"@types/node": "22.10.2",
"drizzle-kit": "0.31.4",
diff --git a/packages/db/src/schema/constants.ts b/packages/db/src/schema/constants.ts
index 25049e7e4..cb0733a39 100644
--- a/packages/db/src/schema/constants.ts
+++ b/packages/db/src/schema/constants.ts
@@ -1,68 +1,11 @@
+import {
+ ALL_REGIONS,
+ AVAILABLE_REGIONS,
+ FLY_REGIONS,
+ FREE_FLY_REGIONS,
+} from "@openstatus/regions";
import { z } from "zod";
-export const flyRegions = [
- "ams",
- "arn",
- "atl",
- "bog",
- "bom",
- "bos",
- "cdg",
- "den",
- "dfw",
- "ewr",
- "eze",
- "fra",
- "gdl",
- "gig",
- "gru",
- "hkg",
- "iad",
- "jnb",
- "lax",
- "lhr",
- "mad",
- "mia",
- "nrt",
- "ord",
- "otp",
- "phx",
- "qro",
- "scl",
- "sjc",
- "sea",
- "sin",
- "syd",
- "waw",
- "yul",
- "yyz",
-] as const;
-
-export const koyebRegions = [
- "koyeb_fra",
- "koyeb_was",
- "koyeb_sin",
- "koyeb_tyo",
- "koyeb_par",
- "koyeb_sfo",
-] as const;
-
-export const railwayRegions = [
- "railway_europe-west4-drams3a",
- "railway_us-east4-eqdc4a",
- "railway_asia-southeast1-eqsg3a",
- "railway_us-west2",
-] as const;
-
-export const freeFlyRegions = [
- "iad",
- "ams",
- "gru",
- "syd",
- "sin",
- "jnb",
-] as const satisfies (typeof flyRegions)[number][];
-
export const monitorPeriodicity = [
"30s",
"1m",
@@ -73,15 +16,13 @@ export const monitorPeriodicity = [
"other",
] as const;
-export const monitorRegions = [
- ...flyRegions,
- ...koyebRegions,
- ...railwayRegions,
-] as const;
-
+export const availableRegions = AVAILABLE_REGIONS;
+export const monitorRegions = ALL_REGIONS;
+export const freeFlyRegions = FREE_FLY_REGIONS;
+export const flyRegions = FLY_REGIONS;
export const monitorPeriodicitySchema = z.enum(monitorPeriodicity);
-export const monitorRegionSchema = z.enum(monitorRegions);
-export const monitorFlyRegionSchema = z.enum(flyRegions);
+export const monitorRegionSchema = z.enum(ALL_REGIONS);
+export const monitorFlyRegionSchema = z.enum(FLY_REGIONS);
export type MonitorFlyRegion = z.infer<typeof monitorFlyRegionSchema>;
export type Region = z.infer<typeof monitorRegionSchema>;
diff --git a/packages/db/src/schema/plan/config.ts b/packages/db/src/schema/plan/config.ts
index 345974a91..2eb2833f5 100644
--- a/packages/db/src/schema/plan/config.ts
+++ b/packages/db/src/schema/plan/config.ts
@@ -1,4 +1,4 @@
-import { type Region, monitorRegions } from "../constants";
+import { type Region, availableRegions } from "../constants";
import type { WorkspacePlan } from "../workspaces/validation";
import type { Limits } from "./schema";
@@ -51,7 +51,7 @@ export const allPlans: Record<
"notification-channels": 1,
members: 1,
"audit-log": false,
- regions: ["ams", "gru", "iad", "jnb", "sin", "syd"] satisfies Region[],
+ regions: ["ams", "gru", "iad", "jnb", "hkg", "syd"] satisfies Region[],
"private-locations": false,
},
},
@@ -89,7 +89,7 @@ export const allPlans: Record<
"notification-channels": 10,
members: "Unlimited",
"audit-log": false,
- regions: [...monitorRegions] satisfies Region[],
+ regions: [...availableRegions],
"private-locations": false,
},
},
@@ -107,7 +107,7 @@ export const allPlans: Record<
"synthetic-checks": 300,
periodicity: ["30s", "1m", "5m", "10m", "30m", "1h"],
"multi-region": true,
- "max-regions": 41,
+ "max-regions": availableRegions.length,
"data-retention": "12 months",
"status-pages": 5,
maintenance: true,
@@ -127,7 +127,7 @@ export const allPlans: Record<
"notification-channels": 20,
members: "Unlimited",
"audit-log": true,
- regions: [...monitorRegions] satisfies Region[],
+ regions: [...availableRegions],
"private-locations": false,
},
},
diff --git a/packages/notifications/email/package.json b/packages/notifications/email/package.json
index 672b575a2..0884935f8 100644
--- a/packages/notifications/email/package.json
+++ b/packages/notifications/email/package.json
@@ -6,6 +6,7 @@
"dependencies": {
"@openstatus/db": "workspace:*",
"@openstatus/emails": "workspace:*",
+ "@openstatus/regions": "workspace:*",
"@openstatus/tinybird": "workspace:*",
"@openstatus/utils": "workspace:*",
"@react-email/components": "0.0.36",
diff --git a/packages/notifications/email/src/index.ts b/packages/notifications/email/src/index.ts
index 48140ef59..7022a658b 100644
--- a/packages/notifications/email/src/index.ts
+++ b/packages/notifications/email/src/index.ts
@@ -6,7 +6,7 @@ import {
import type { Region } from "@openstatus/db/src/schema/constants";
import { EmailClient } from "@openstatus/emails/src/client";
-import { regionDict } from "@openstatus/utils";
+import { regionDict } from "@openstatus/regions";
import { env } from "../env";
const emailClient = new EmailClient({ apiKey: env.RESEND_API_KEY });
diff --git a/packages/regions/index.ts b/packages/regions/index.ts
new file mode 100644
index 000000000..a2bbc722b
--- /dev/null
+++ b/packages/regions/index.ts
@@ -0,0 +1,495 @@
+export const FLY_REGIONS = [
+ "ams",
+ "arn",
+ "atl",
+ "bog",
+ "bom",
+ "bos",
+ "cdg",
+ "den",
+ "dfw",
+ "ewr",
+ "eze",
+ "fra",
+ "gdl",
+ "gig",
+ "gru",
+ "hkg",
+ "iad",
+ "jnb",
+ "lax",
+ "lhr",
+ "mad",
+ "mia",
+ "nrt",
+ "ord",
+ "otp",
+ "phx",
+ "qro",
+ "scl",
+ "sjc",
+ "sea",
+ "sin",
+ "syd",
+ "waw",
+ "yul",
+ "yyz",
+] as const;
+
+export const KOYEB_REGIONS = [
+ "koyeb_fra",
+ "koyeb_was",
+ "koyeb_sin",
+ "koyeb_tyo",
+ "koyeb_par",
+ "koyeb_sfo",
+] as const;
+
+export const RAILWAY_REGIONS = [
+ "railway_europe-west4-drams3a",
+ "railway_us-east4-eqdc4a",
+ "railway_asia-southeast1-eqsg3a",
+ "railway_us-west2",
+] as const;
+
+export const FREE_FLY_REGIONS = [
+ "iad",
+ "ams",
+ "gru",
+ "syd",
+ "sin",
+ "jnb",
+] as const satisfies (typeof FLY_REGIONS)[number][];
+
+export const ALL_REGIONS = [
+ ...FLY_REGIONS,
+ ...KOYEB_REGIONS,
+ ...RAILWAY_REGIONS,
+] as const;
+
+export type Region = (typeof ALL_REGIONS)[number];
+
+export type Continent =
+ | "Europe"
+ | "North America"
+ | "South America"
+ | "Asia"
+ | "Africa"
+ | "Oceania";
+
+export type RegionInfo = {
+ code: Region;
+ location: string;
+ flag: string;
+ continent: Continent;
+ deprecated: boolean;
+ provider: "fly" | "koyeb" | "railway";
+};
+
+// TODO: we could think of doing the inverse and use "EU" as key
+export const continentDict: Record<Continent, { code: string }> = {
+ Europe: { code: "EU" },
+ "North America": { code: "NA" },
+ "South America": { code: "SA" },
+ Asia: { code: "AS" },
+ Africa: { code: "AF" },
+ Oceania: { code: "OC" },
+};
+
+export const regionDict: Record<Region, RegionInfo> = {
+ ams: {
+ code: "ams",
+ location: "Amsterdam, Netherlands",
+ flag: "๐Ÿ‡ณ๐Ÿ‡ฑ",
+ continent: "Europe",
+ deprecated: false,
+ provider: "fly",
+ },
+ arn: {
+ code: "arn",
+ location: "Stockholm, Sweden",
+ flag: "๐Ÿ‡ธ๐Ÿ‡ช",
+ continent: "Europe",
+ deprecated: false,
+ provider: "fly",
+ },
+
+ atl: {
+ code: "atl",
+ location: "Atlanta, Georgia, USA",
+ flag: "๐Ÿ‡บ๐Ÿ‡ธ",
+ continent: "North America",
+ deprecated: true,
+ provider: "fly",
+ },
+ bog: {
+ code: "bog",
+ location: "Bogotรก, Colombia",
+ flag: "๐Ÿ‡จ๐Ÿ‡ด",
+ continent: "South America",
+ deprecated: true,
+ provider: "fly",
+ },
+ bom: {
+ code: "bom",
+ location: "Mumbai, India",
+ flag: "๐Ÿ‡ฎ๐Ÿ‡ณ",
+ continent: "Asia",
+ deprecated: false,
+ provider: "fly",
+ },
+ bos: {
+ code: "bos",
+ location: "Boston, Massachusetts, USA",
+ flag: "๐Ÿ‡บ๐Ÿ‡ธ",
+ continent: "North America",
+ deprecated: true,
+ provider: "fly",
+ },
+ cdg: {
+ code: "cdg",
+ location: "Paris, France",
+ flag: "๐Ÿ‡ซ๐Ÿ‡ท",
+ continent: "Europe",
+ deprecated: false,
+ provider: "fly",
+ },
+ den: {
+ code: "den",
+ location: "Denver, Colorado, USA",
+ flag: "๐Ÿ‡บ๐Ÿ‡ธ",
+ continent: "North America",
+ deprecated: true,
+ provider: "fly",
+ },
+ dfw: {
+ code: "dfw",
+ location: "Dallas, Texas, USA",
+ flag: "๐Ÿ‡บ๐Ÿ‡ธ",
+ continent: "North America",
+ deprecated: false,
+ provider: "fly",
+ },
+ ewr: {
+ code: "ewr",
+ location: "Secaucus, New Jersey, USA",
+ flag: "๐Ÿ‡บ๐Ÿ‡ธ",
+ continent: "North America",
+ deprecated: false,
+ provider: "fly",
+ },
+ eze: {
+ code: "eze",
+ location: "Ezeiza, Argentina",
+ flag: "๐Ÿ‡ฆ๐Ÿ‡ท",
+ continent: "South America",
+ deprecated: true,
+ provider: "fly",
+ },
+ fra: {
+ code: "fra",
+ location: "Frankfurt, Germany",
+ flag: "๐Ÿ‡ฉ๐Ÿ‡ช",
+ continent: "Europe",
+ deprecated: false,
+ provider: "fly",
+ },
+ gdl: {
+ code: "gdl",
+ location: "Guadalajara, Mexico",
+ flag: "๐Ÿ‡ฒ๐Ÿ‡ฝ",
+ continent: "North America",
+ deprecated: true,
+ provider: "fly",
+ },
+ gig: {
+ code: "gig",
+ location: "Rio de Janeiro, Brazil",
+ flag: "๐Ÿ‡ง๐Ÿ‡ท",
+ continent: "South America",
+ deprecated: true,
+ provider: "fly",
+ },
+ gru: {
+ code: "gru",
+ location: "Sao Paulo, Brazil",
+ flag: "๐Ÿ‡ง๐Ÿ‡ท",
+ continent: "South America",
+ deprecated: false,
+ provider: "fly",
+ },
+ hkg: {
+ code: "hkg",
+ location: "Hong Kong, Hong Kong",
+ flag: "๐Ÿ‡ญ๐Ÿ‡ฐ",
+ continent: "Asia",
+ deprecated: true,
+ provider: "fly",
+ },
+ iad: {
+ code: "iad",
+ location: "Ashburn, Virginia, USA",
+ flag: "๐Ÿ‡บ๐Ÿ‡ธ",
+ continent: "North America",
+ deprecated: false,
+ provider: "fly",
+ },
+ jnb: {
+ code: "jnb",
+ location: "Johannesburg, South Africa",
+ flag: "๐Ÿ‡ฟ๐Ÿ‡ฆ",
+ continent: "Africa",
+ deprecated: false,
+ provider: "fly",
+ },
+ lax: {
+ code: "lax",
+ location: "Los Angeles, California, USA",
+ flag: "๐Ÿ‡บ๐Ÿ‡ธ",
+ continent: "North America",
+ deprecated: false,
+ provider: "fly",
+ },
+ lhr: {
+ code: "lhr",
+ location: "London, United Kingdom",
+ flag: "๐Ÿ‡ฌ๐Ÿ‡ง",
+ continent: "Europe",
+ deprecated: false,
+ provider: "fly",
+ },
+ mad: {
+ code: "mad",
+ location: "Madrid, Spain",
+ flag: "๐Ÿ‡ช๐Ÿ‡ธ",
+ continent: "Europe",
+ deprecated: true,
+ provider: "fly",
+ },
+ mia: {
+ code: "mia",
+ location: "Miami, Florida, USA",
+ flag: "๐Ÿ‡บ๐Ÿ‡ธ",
+ continent: "North America",
+ deprecated: true,
+ provider: "fly",
+ },
+ nrt: {
+ code: "nrt",
+ location: "Tokyo, Japan",
+ flag: "๐Ÿ‡ฏ๐Ÿ‡ต",
+ continent: "Asia",
+ deprecated: false,
+ provider: "fly",
+ },
+ ord: {
+ code: "ord",
+ location: "Chicago, Illinois, USA",
+ flag: "๐Ÿ‡บ๐Ÿ‡ธ",
+ continent: "North America",
+ deprecated: false,
+ provider: "fly",
+ },
+ otp: {
+ code: "otp",
+ location: "Bucharest, Romania",
+ flag: "๐Ÿ‡ท๐Ÿ‡ด",
+ continent: "Europe",
+ deprecated: true,
+ provider: "fly",
+ },
+ phx: {
+ code: "phx",
+ location: "Phoenix, Arizona, USA",
+ flag: "๐Ÿ‡บ๐Ÿ‡ธ",
+ continent: "North America",
+ deprecated: true,
+ provider: "fly",
+ },
+ qro: {
+ code: "qro",
+ location: "Querรฉtaro, Mexico",
+ flag: "๐Ÿ‡ฒ๐Ÿ‡ฝ",
+ continent: "North America",
+ deprecated: true,
+ provider: "fly",
+ },
+ scl: {
+ code: "scl",
+ location: "Santiago, Chile",
+ flag: "๐Ÿ‡จ๐Ÿ‡ฑ",
+ continent: "South America",
+ deprecated: true,
+ provider: "fly",
+ },
+ sjc: {
+ code: "sjc",
+ location: "San Jose, California, USA",
+ flag: "๐Ÿ‡บ๐Ÿ‡ธ",
+ continent: "North America",
+ deprecated: false,
+ provider: "fly",
+ },
+ sea: {
+ code: "sea",
+ location: "Seattle, Washington, USA",
+ flag: "๐Ÿ‡บ๐Ÿ‡ธ",
+ continent: "North America",
+ deprecated: true,
+ provider: "fly",
+ },
+ sin: {
+ code: "sin",
+ location: "Singapore, Singapore",
+ flag: "๐Ÿ‡ธ๐Ÿ‡ฌ",
+ continent: "Asia",
+ deprecated: false,
+ provider: "fly",
+ },
+ syd: {
+ code: "syd",
+ location: "Sydney, Australia",
+ flag: "๐Ÿ‡ฆ๐Ÿ‡บ",
+ continent: "Oceania",
+ deprecated: false,
+ provider: "fly",
+ },
+ waw: {
+ code: "waw",
+ location: "Warsaw, Poland",
+ flag: "๐Ÿ‡ต๐Ÿ‡ฑ",
+ continent: "Europe",
+ deprecated: true,
+ provider: "fly",
+ },
+ yul: {
+ code: "yul",
+ location: "Montreal, Canada",
+ flag: "๐Ÿ‡จ๐Ÿ‡ฆ",
+ continent: "North America",
+ deprecated: true,
+ provider: "fly",
+ },
+ yyz: {
+ code: "yyz",
+ location: "Toronto, Canada",
+ flag: "๐Ÿ‡จ๐Ÿ‡ฆ",
+ continent: "North America",
+ deprecated: false,
+ provider: "fly",
+ },
+ koyeb_fra: {
+ code: "koyeb_fra",
+ location: "Frankfurt, Germany",
+ flag: "๐Ÿ‡ฉ๐Ÿ‡ช",
+ continent: "Europe",
+ deprecated: false,
+ provider: "koyeb",
+ },
+ koyeb_par: {
+ code: "koyeb_par",
+ location: "Paris, France",
+ flag: "๐Ÿ‡ซ๐Ÿ‡ท",
+ continent: "Europe",
+ deprecated: false,
+ provider: "koyeb",
+ },
+ koyeb_sfo: {
+ code: "koyeb_sfo",
+ location: "San Francisco, USA",
+ flag: "๐Ÿ‡บ๐Ÿ‡ธ",
+ continent: "North America",
+ deprecated: false,
+ provider: "koyeb",
+ },
+ koyeb_sin: {
+ code: "koyeb_sin",
+ location: "Singapore, Singapore",
+ flag: "๐Ÿ‡ธ๐Ÿ‡ฌ",
+ continent: "Asia",
+ deprecated: false,
+ provider: "koyeb",
+ },
+ koyeb_tyo: {
+ code: "koyeb_tyo",
+ location: "Tokyo, Japan",
+ flag: "๐Ÿ‡ฏ๐Ÿ‡ต",
+ continent: "Asia",
+ deprecated: false,
+ provider: "koyeb",
+ },
+ koyeb_was: {
+ code: "koyeb_was",
+ location: "Washington, USA",
+ flag: "๐Ÿ‡บ๐Ÿ‡ธ",
+ continent: "North America",
+ deprecated: false,
+ provider: "koyeb",
+ },
+ "railway_us-west2": {
+ code: "railway_us-west2",
+ location: "California, USA",
+ flag: "๐Ÿ‡บ๐Ÿ‡ธ",
+ continent: "North America",
+ deprecated: false,
+ provider: "railway",
+ },
+ "railway_us-east4-eqdc4a": {
+ code: "railway_us-east4-eqdc4a",
+ location: "Virginia, USA",
+ flag: "๐Ÿ‡บ๐Ÿ‡ธ",
+ continent: "North America",
+ deprecated: false,
+ provider: "railway",
+ },
+ "railway_europe-west4-drams3a": {
+ code: "railway_europe-west4-drams3a",
+ location: "Amsterdam, Netherlands",
+ flag: "๐Ÿ‡ณ๐Ÿ‡ฑ",
+ continent: "Europe",
+ deprecated: false,
+ provider: "railway",
+ },
+ "railway_asia-southeast1-eqsg3a": {
+ code: "railway_asia-southeast1-eqsg3a",
+ location: "Singapore, Singapore",
+ flag: "๐Ÿ‡ธ๐Ÿ‡ฌ",
+ continent: "Asia",
+ deprecated: false,
+ provider: "railway",
+ },
+} as const;
+
+export const AVAILABLE_REGIONS = ALL_REGIONS.filter(
+ (r) => !regionDict[r].deprecated,
+);
+
+export function formatRegionCode(region: RegionInfo | Region) {
+ const r = typeof region === "string" ? regionDict[region] : region;
+ const suffix = r.code.replace(/(koyeb_|railway_|fly_)/g, "");
+
+ if (r.provider === "railway") {
+ return suffix.replace(/(-eqdc4a|-eqsg3a|-drams3a)/g, "");
+ }
+
+ return suffix;
+}
+
+export const groupByContinent = Object.entries(regionDict).reduce<
+ Record<Continent, RegionInfo[]>
+>(
+ (acc, [_key, value]) => {
+ Object.assign(acc, {
+ [value.continent]: [...acc[value.continent], value],
+ });
+ return acc;
+ },
+ {
+ "North America": [],
+ Europe: [],
+ "South America": [],
+ Oceania: [],
+ Asia: [],
+ Africa: [],
+ },
+);
diff --git a/packages/regions/package.json b/packages/regions/package.json
new file mode 100644
index 000000000..4c3cfe401
--- /dev/null
+++ b/packages/regions/package.json
@@ -0,0 +1,17 @@
+{
+ "name": "@openstatus/regions",
+ "version": "1.0.0",
+ "description": "",
+ "main": "index.ts",
+ "scripts": {},
+ "dependencies": {
+ "zod": "3.24.2"
+ },
+ "devDependencies": {
+ "@openstatus/tsconfig": "workspace:*",
+ "typescript": "5.7.2"
+ },
+ "keywords": [],
+ "author": "",
+ "license": "ISC"
+}
diff --git a/packages/regions/tsconfig.json b/packages/regions/tsconfig.json
new file mode 100644
index 000000000..aed15c74a
--- /dev/null
+++ b/packages/regions/tsconfig.json
@@ -0,0 +1,4 @@
+{
+ "extends": "@openstatus/tsconfig/base.json",
+ "include": ["src", "*.ts"]
+}
diff --git a/packages/utils/index.ts b/packages/utils/index.ts
index 337c6927f..0eb6863a2 100644
--- a/packages/utils/index.ts
+++ b/packages/utils/index.ts
@@ -1,456 +1,8 @@
-import type { Region } from "@openstatus/db/src/schema/constants";
-
import { base } from "@openstatus/assertions";
import { monitorMethods, monitorStatus } from "@openstatus/db/src/schema";
import { z } from "zod";
-export type Continent =
- | "Europe"
- | "North America"
- | "South America"
- | "Asia"
- | "Africa"
- | "Oceania";
-
-export type RegionInfo = {
- code: Region;
- location: string;
- flag: string;
- continent: Continent;
- deprecated: boolean;
- provider: "fly" | "koyeb" | "railway";
-};
-
-// TODO: we could think of doing the inverse and use "EU" as key
-export const continentDict: Record<Continent, { code: string }> = {
- Europe: { code: "EU" },
- "North America": { code: "NA" },
- "South America": { code: "SA" },
- Asia: { code: "AS" },
- Africa: { code: "AF" },
- Oceania: { code: "OC" },
-};
-
-export const regionDict: Record<Region, RegionInfo> = {
- ams: {
- code: "ams",
- location: "Amsterdam, Netherlands",
- flag: "๐Ÿ‡ณ๐Ÿ‡ฑ",
- continent: "Europe",
- deprecated: false,
- provider: "fly",
- },
- arn: {
- code: "arn",
- location: "Stockholm, Sweden",
- flag: "๐Ÿ‡ธ๐Ÿ‡ช",
- continent: "Europe",
- deprecated: false,
- provider: "fly",
- },
-
- atl: {
- code: "atl",
- location: "Atlanta, Georgia, USA",
- flag: "๐Ÿ‡บ๐Ÿ‡ธ",
- continent: "North America",
- deprecated: true,
- provider: "fly",
- },
- bog: {
- code: "bog",
- location: "Bogotรก, Colombia",
- flag: "๐Ÿ‡จ๐Ÿ‡ด",
- continent: "South America",
- deprecated: true,
- provider: "fly",
- },
- bom: {
- code: "bom",
- location: "Mumbai, India",
- flag: "๐Ÿ‡ฎ๐Ÿ‡ณ",
- continent: "Asia",
- deprecated: false,
- provider: "fly",
- },
- bos: {
- code: "bos",
- location: "Boston, Massachusetts, USA",
- flag: "๐Ÿ‡บ๐Ÿ‡ธ",
- continent: "North America",
- deprecated: true,
- provider: "fly",
- },
- cdg: {
- code: "cdg",
- location: "Paris, France",
- flag: "๐Ÿ‡ซ๐Ÿ‡ท",
- continent: "Europe",
- deprecated: false,
- provider: "fly",
- },
- den: {
- code: "den",
- location: "Denver, Colorado, USA",
- flag: "๐Ÿ‡บ๐Ÿ‡ธ",
- continent: "North America",
- deprecated: true,
- provider: "fly",
- },
- dfw: {
- code: "dfw",
- location: "Dallas, Texas, USA",
- flag: "๐Ÿ‡บ๐Ÿ‡ธ",
- continent: "North America",
- deprecated: false,
- provider: "fly",
- },
- ewr: {
- code: "ewr",
- location: "Secaucus, New Jersey, USA",
- flag: "๐Ÿ‡บ๐Ÿ‡ธ",
- continent: "North America",
- deprecated: false,
- provider: "fly",
- },
- eze: {
- code: "eze",
- location: "Ezeiza, Argentina",
- flag: "๐Ÿ‡ฆ๐Ÿ‡ท",
- continent: "South America",
- deprecated: true,
- provider: "fly",
- },
- fra: {
- code: "fra",
- location: "Frankfurt, Germany",
- flag: "๐Ÿ‡ฉ๐Ÿ‡ช",
- continent: "Europe",
- deprecated: false,
- provider: "fly",
- },
- gdl: {
- code: "gdl",
- location: "Guadalajara, Mexico",
- flag: "๐Ÿ‡ฒ๐Ÿ‡ฝ",
- continent: "North America",
- deprecated: true,
- provider: "fly",
- },
- gig: {
- code: "gig",
- location: "Rio de Janeiro, Brazil",
- flag: "๐Ÿ‡ง๐Ÿ‡ท",
- continent: "South America",
- deprecated: true,
- provider: "fly",
- },
- gru: {
- code: "gru",
- location: "Sao Paulo, Brazil",
- flag: "๐Ÿ‡ง๐Ÿ‡ท",
- continent: "South America",
- deprecated: false,
- provider: "fly",
- },
- hkg: {
- code: "hkg",
- location: "Hong Kong, Hong Kong",
- flag: "๐Ÿ‡ญ๐Ÿ‡ฐ",
- continent: "Asia",
- deprecated: true,
- provider: "fly",
- },
- iad: {
- code: "iad",
- location: "Ashburn, Virginia, USA",
- flag: "๐Ÿ‡บ๐Ÿ‡ธ",
- continent: "North America",
- deprecated: false,
- provider: "fly",
- },
- jnb: {
- code: "jnb",
- location: "Johannesburg, South Africa",
- flag: "๐Ÿ‡ฟ๐Ÿ‡ฆ",
- continent: "Africa",
- deprecated: false,
- provider: "fly",
- },
- lax: {
- code: "lax",
- location: "Los Angeles, California, USA",
- flag: "๐Ÿ‡บ๐Ÿ‡ธ",
- continent: "North America",
- deprecated: false,
- provider: "fly",
- },
- lhr: {
- code: "lhr",
- location: "London, United Kingdom",
- flag: "๐Ÿ‡ฌ๐Ÿ‡ง",
- continent: "Europe",
- deprecated: false,
- provider: "fly",
- },
- mad: {
- code: "mad",
- location: "Madrid, Spain",
- flag: "๐Ÿ‡ช๐Ÿ‡ธ",
- continent: "Europe",
- deprecated: true,
- provider: "fly",
- },
- mia: {
- code: "mia",
- location: "Miami, Florida, USA",
- flag: "๐Ÿ‡บ๐Ÿ‡ธ",
- continent: "North America",
- deprecated: true,
- provider: "fly",
- },
- nrt: {
- code: "nrt",
- location: "Tokyo, Japan",
- flag: "๐Ÿ‡ฏ๐Ÿ‡ต",
- continent: "Asia",
- deprecated: false,
- provider: "fly",
- },
- ord: {
- code: "ord",
- location: "Chicago, Illinois, USA",
- flag: "๐Ÿ‡บ๐Ÿ‡ธ",
- continent: "North America",
- deprecated: false,
- provider: "fly",
- },
- otp: {
- code: "otp",
- location: "Bucharest, Romania",
- flag: "๐Ÿ‡ท๐Ÿ‡ด",
- continent: "Europe",
- deprecated: true,
- provider: "fly",
- },
- phx: {
- code: "phx",
- location: "Phoenix, Arizona, USA",
- flag: "๐Ÿ‡บ๐Ÿ‡ธ",
- continent: "North America",
- deprecated: true,
- provider: "fly",
- },
- qro: {
- code: "qro",
- location: "Querรฉtaro, Mexico",
- flag: "๐Ÿ‡ฒ๐Ÿ‡ฝ",
- continent: "North America",
- deprecated: true,
- provider: "fly",
- },
- scl: {
- code: "scl",
- location: "Santiago, Chile",
- flag: "๐Ÿ‡จ๐Ÿ‡ฑ",
- continent: "South America",
- deprecated: true,
- provider: "fly",
- },
- sjc: {
- code: "sjc",
- location: "San Jose, California, USA",
- flag: "๐Ÿ‡บ๐Ÿ‡ธ",
- continent: "North America",
- deprecated: false,
- provider: "fly",
- },
- sea: {
- code: "sea",
- location: "Seattle, Washington, USA",
- flag: "๐Ÿ‡บ๐Ÿ‡ธ",
- continent: "North America",
- deprecated: true,
- provider: "fly",
- },
- sin: {
- code: "sin",
- location: "Singapore, Singapore",
- flag: "๐Ÿ‡ธ๐Ÿ‡ฌ",
- continent: "Asia",
- deprecated: false,
- provider: "fly",
- },
- syd: {
- code: "syd",
- location: "Sydney, Australia",
- flag: "๐Ÿ‡ฆ๐Ÿ‡บ",
- continent: "Oceania",
- deprecated: false,
- provider: "fly",
- },
- waw: {
- code: "waw",
- location: "Warsaw, Poland",
- flag: "๐Ÿ‡ต๐Ÿ‡ฑ",
- continent: "Europe",
- deprecated: true,
- provider: "fly",
- },
- yul: {
- code: "yul",
- location: "Montreal, Canada",
- flag: "๐Ÿ‡จ๐Ÿ‡ฆ",
- continent: "North America",
- deprecated: true,
- provider: "fly",
- },
- yyz: {
- code: "yyz",
- location: "Toronto, Canada",
- flag: "๐Ÿ‡จ๐Ÿ‡ฆ",
- continent: "North America",
- deprecated: false,
- provider: "fly",
- },
- koyeb_fra: {
- code: "koyeb_fra",
- location: "Frankfurt, Germany",
- flag: "๐Ÿ‡ฉ๐Ÿ‡ช",
- continent: "Europe",
- deprecated: false,
- provider: "koyeb",
- },
- koyeb_par: {
- code: "koyeb_par",
- location: "Paris, France",
- flag: "๐Ÿ‡ซ๐Ÿ‡ท",
- continent: "Europe",
- deprecated: false,
- provider: "koyeb",
- },
- koyeb_sfo: {
- code: "koyeb_sfo",
- location: "San Francisco, USA",
- flag: "๐Ÿ‡บ๐Ÿ‡ธ",
- continent: "North America",
- deprecated: false,
- provider: "koyeb",
- },
- koyeb_sin: {
- code: "koyeb_sin",
- location: "Singapore, Singapore",
- flag: "๐Ÿ‡ธ๐Ÿ‡ฌ",
- continent: "Asia",
- deprecated: false,
- provider: "koyeb",
- },
- koyeb_tyo: {
- code: "koyeb_tyo",
- location: "Tokyo, Japan",
- flag: "๐Ÿ‡ฏ๐Ÿ‡ต",
- continent: "Asia",
- deprecated: false,
- provider: "koyeb",
- },
- koyeb_was: {
- code: "koyeb_was",
- location: "Washington, USA",
- flag: "๐Ÿ‡บ๐Ÿ‡ธ",
- continent: "North America",
- deprecated: false,
- provider: "koyeb",
- },
- "railway_us-west2": {
- code: "railway_us-west2",
- location: "California, USA",
- flag: "๐Ÿ‡บ๐Ÿ‡ธ",
- continent: "North America",
- deprecated: false,
- provider: "railway",
- },
- "railway_us-east4-eqdc4a": {
- code: "railway_us-east4-eqdc4a",
- location: "Virginia, USA",
- flag: "๐Ÿ‡บ๐Ÿ‡ธ",
- continent: "North America",
- deprecated: false,
- provider: "railway",
- },
- "railway_europe-west4-drams3a": {
- code: "railway_europe-west4-drams3a",
- location: "Amsterdam, Netherlands",
- flag: "๐Ÿ‡ณ๐Ÿ‡ฑ",
- continent: "Europe",
- deprecated: false,
- provider: "railway",
- },
- "railway_asia-southeast1-eqsg3a": {
- code: "railway_asia-southeast1-eqsg3a",
- location: "Singapore, Singapore",
- flag: "๐Ÿ‡ธ๐Ÿ‡ฌ",
- continent: "Asia",
- deprecated: false,
- provider: "railway",
- },
-} as const;
-
-export function formatRegionCode(region: RegionInfo | Region) {
- const r = typeof region === "string" ? regionDict[region] : region;
- const suffix = r.code.replace(/(koyeb_|railway_|fly_)/g, "");
-
- if (r.provider === "railway") {
- return suffix.replace(/(-eqdc4a|-eqsg3a|-drams3a)/g, "");
- }
-
- return suffix;
-}
-
-export const groupByContinent = Object.entries(regionDict).reduce<
- Record<Continent, RegionInfo[]>
->(
- (acc, [_key, value]) => {
- Object.assign(acc, {
- [value.continent]: [...acc[value.continent], value],
- });
- return acc;
- },
- {
- "North America": [],
- Europe: [],
- "South America": [],
- Oceania: [],
- Asia: [],
- Africa: [],
- },
-);
-
-export const vercelRegions = [
- "arn1",
- "bom1",
- "cdg1",
- "cle1",
- "cpt1",
- "dub1",
- "fra1",
- "gru1",
- "hkg1",
- "hnd1",
- "iad1",
- "icn1",
- "kix1",
- "lhr1",
- "pdx1",
- "sfo1",
- "sin1",
- "syd1",
-] as const;
-
-// export const availableRegions = [...vercelRegions, ...flyRegions] as const;
-
-// export const regionsDict = { ...vercelRegionsDict, ...flyRegionsDict } as const;
-
export const httpPayloadSchema = z.object({
workspaceId: z.string(),
monitorId: z.string(),
diff --git a/packages/utils/package.json b/packages/utils/package.json
index cbaa977fe..f0082cc38 100644
--- a/packages/utils/package.json
+++ b/packages/utils/package.json
@@ -4,14 +4,16 @@
"description": "",
"main": "index.ts",
"scripts": {},
- "dependencies": {},
- "devDependencies": {
+ "dependencies": {
"@openstatus/assertions": "workspace:*",
"@openstatus/db": "workspace:*",
- "@openstatus/tsconfig": "workspace:*",
- "typescript": "5.7.2",
+ "@openstatus/regions": "workspace:*",
"zod": "3.24.2"
},
+ "devDependencies": {
+ "@openstatus/tsconfig": "workspace:*",
+ "typescript": "5.7.2"
+ },
"keywords": [],
"author": "",
"license": "ISC"
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 80b1fbe5b..89c4c0785 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -113,6 +113,9 @@ importers:
'@openstatus/react':
specifier: workspace:*
version: link:../../packages/react
+ '@openstatus/regions':
+ specifier: workspace:*
+ version: link:../../packages/regions
'@openstatus/theme-store':
specifier: workspace:*
version: link:../../packages/theme-store
@@ -187,7 +190,7 @@ importers:
'@sentry/nextjs':
specifier: 8.46.0
'@stripe/stripe-js':
specifier: 2.1.6
version: 2.1.6
@@ -202,7 +205,7 @@ importers:
'@trpc/next':
specifier: 11.4.4
'@trpc/react-query':
specifier: 11.4.4
@@ -440,6 +443,9 @@ importers:
'@openstatus/error':
specifier: workspace:*
version: link:../../packages/error
+ '@openstatus/regions':
+ specifier: workspace:*
+ version: link:../../packages/regions
'@openstatus/tinybird':
specifier: workspace:*
version: link:../../packages/tinybird
@@ -650,7 +656,7 @@ importers:
'@sentry/nextjs':
specifier: 8.46.0
'@stripe/stripe-js':
specifier: 2.1.6
version: 2.1.6
@@ -665,7 +671,7 @@ importers:
'@trpc/next':
specifier: 11.4.4
'@trpc/react-query':
specifier: 11.4.4
@@ -853,6 +859,9 @@ importers:
'@openstatus/react':
specifier: workspace:*
version: link:../../packages/react
+ '@openstatus/regions':
+ specifier: workspace:*
+ version: link:../../packages/regions
'@openstatus/tinybird':
specifier: workspace:*
version: link:../../packages/tinybird
@@ -1180,6 +1189,9 @@ importers:
'@openstatus/error':
specifier: workspace:*
version: link:../error
+ '@openstatus/regions':
+ specifier: workspace:*
+ version: link:../regions
'@openstatus/tinybird':
specifier: workspace:*
version: link:../tinybird
@@ -1263,6 +1275,12 @@ importers:
'@libsql/client':
specifier: 0.15.14
+ '@openstatus/assertions':
+ specifier: workspace:*
+ version: link:../assertions
+ '@openstatus/regions':
+ specifier: workspace:*
+ version: link:../regions
'@t3-oss/env-core':
specifier: 0.7.1
@@ -1276,9 +1294,6 @@ importers:
specifier: 3.24.2
version: 3.24.2
devDependencies:
- '@openstatus/assertions':
- specifier: workspace:*
- version: link:../assertions
'@openstatus/tsconfig':
specifier: workspace:*
version: link:../tsconfig
@@ -1415,6 +1430,9 @@ importers:
'@openstatus/emails':
specifier: workspace:*
version: link:../../emails
+ '@openstatus/regions':
+ specifier: workspace:*
+ version: link:../../regions
'@openstatus/tinybird':
specifier: workspace:*
version: link:../../tinybird
@@ -1631,6 +1649,19 @@ importers:
specifier: 5.7.2
version: 5.7.2
+ packages/regions:
+ dependencies:
+ zod:
+ specifier: 3.24.2
+ version: 3.24.2
+ devDependencies:
+ '@openstatus/tsconfig':
+ specifier: workspace:*
+ version: link:../tsconfig
+ typescript:
+ specifier: 5.7.2
+ version: 5.7.2
+
packages/theme-store:
devDependencies:
'@openstatus/tsconfig':
@@ -1869,22 +1900,26 @@ importers:
version: 5.7.2
packages/utils:
- devDependencies:
+ dependencies:
'@openstatus/assertions':
specifier: workspace:*
version: link:../assertions
'@openstatus/db':
specifier: workspace:*
version: link:../db
+ '@openstatus/regions':
+ specifier: workspace:*
+ version: link:../regions
+ zod:
+ specifier: 3.24.2
+ version: 3.24.2
+ devDependencies:
'@openstatus/tsconfig':
specifier: workspace:*
version: link:../tsconfig
typescript:
specifier: 5.7.2
version: 5.7.2
- zod:
- specifier: 3.24.2
- version: 3.24.2
packages:
@@ -16339,7 +16374,7 @@ snapshots:
'@sentry/types': 8.9.2
'@sentry/utils': 8.9.2
dependencies:
'@opentelemetry/api': 1.9.0
'@opentelemetry/semantic-conventions': 1.28.0
@@ -16350,7 +16385,7 @@ snapshots:
'@sentry/opentelemetry': 8.46.0(@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected])
'@sentry/react': 8.46.0([email protected])
'@sentry/vercel-edge': 8.46.0
- '@sentry/webpack-plugin': 2.22.7([email protected])([email protected]([email protected]))
+ '@sentry/webpack-plugin': 2.22.7([email protected])([email protected])
chalk: 3.0.0
resolve: 1.22.8
@@ -16365,7 +16400,7 @@ snapshots:
- supports-color
- webpack
dependencies:
'@opentelemetry/api': 1.9.0
'@opentelemetry/semantic-conventions': 1.28.0
@@ -16376,7 +16411,7 @@ snapshots:
'@sentry/opentelemetry': 8.46.0(@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected])
'@sentry/react': 8.46.0([email protected])
'@sentry/vercel-edge': 8.46.0
- '@sentry/webpack-plugin': 2.22.7([email protected])([email protected])
+ '@sentry/webpack-plugin': 2.22.7([email protected])([email protected]([email protected]))
chalk: 3.0.0
resolve: 1.22.8
@@ -17129,7 +17164,7 @@ snapshots:
'@tanstack/react-query': 5.80.7([email protected])
dependencies:
'@trpc/server': 11.4.4([email protected])