update openapi docs

This commit is contained in:
Alex Holliday committed 2026-08-17 12:36:39 -07:00
1 parent c1f0bf3dd4
commit ab7f2cd8f4
6 files changed
+429 -24

No files matched your search

+48 -3
View File
@@ -1,14 +1,59 @@
import { registry } from "../registry.js";
import { bearer, multipart, okJsonNoData, okUnknown, standardErrors } from "../helpers.js";
import { bearer, multipart, okJson, okJsonNoData, okUnknown, standardErrors } from "../helpers.js";
import {
createStatusPageBodyValidation,
getStatusPageParamValidation,
getStatusPageQueryValidation,
publicStatusPagePayloadResponseSchema,
resolveStatusPageQueryValidation,
} from "@/api/validation/statusPageValidation.js";
const tags = ["status-page"];
const publicStatusPageObject = publicStatusPagePayloadResponseSchema.openapi("PublicStatusPagePayload", {
example: {
statusPage: {
id: "65f1c2a4d8b9e0123456789c",
userId: "65f1c2a4d8b9e01234567891",
teamId: "65f1c2a4d8b9e01234567890",
type: ["uptime"],
companyName: "Acme",
url: "acme-status",
customDomain: null,
timezone: "America/Toronto",
color: "#4169E1",
monitors: ["65f1c2a4d8b9e0123456789a"],
subMonitors: [],
isPublished: true,
showCharts: true,
showUptimePercentage: true,
showAdminLoginLink: false,
showInfrastructure: false,
customCSS: "",
theme: "refined",
themeMode: "auto",
createdAt: "2026-04-01T10:00:00.000Z",
updatedAt: "2026-04-15T14:30:00.000Z",
},
range: "90d",
bucketTimezone: "America/Toronto",
checkTTLDays: 30,
monitors: [
{
id: "65f1c2a4d8b9e0123456789a",
name: "API",
type: "http",
status: "up",
uptimePercentage: 0.9987,
recentChecks: [],
dailyChecks: [
{ monitorId: "65f1c2a4d8b9e0123456789a", date: "2026-07-19", totalChecks: 2880, upChecks: 2877, downChecks: 3, avgResponseTime: 142 },
],
},
],
},
});
registry.registerPath({
method: "get",
path: "/status-page/team",
@@ -44,7 +89,7 @@ registry.registerPath({
tags,
summary: "Resolve a published status page by custom domain",
request: { query: resolveStatusPageQueryValidation },
responses: { "200": okUnknown, "404": { description: "Status page not found" }, "500": standardErrors["500"] },
responses: { "200": okJson(publicStatusPageObject), "404": { description: "Status page not found" }, "500": standardErrors["500"] },
});
registry.registerPath({
@@ -53,7 +98,7 @@ registry.registerPath({
tags,
summary: "Get a public status page by its URL slug",
request: { params: getStatusPageParamValidation, query: getStatusPageQueryValidation },
responses: { "200": okUnknown, "404": { description: "Status page not found" }, "500": standardErrors["500"] },
responses: { "200": okJson(publicStatusPageObject), "404": { description: "Status page not found" }, "500": standardErrors["500"] },
});
registry.registerPath({