Builds OpenAPI security definitions and tags for a SaaS API.
// Source: https://github.com/LubomirGeorgiev/cloudflare-workers-nextjs-saas-template | License: MIT | Copyright 2025 Lubomir Georgiev (Любомир Георгиев)
// Provided via justclaw.it.com; keep this notice with the code.
import type { OpenAPIV3_1 } from "openapi-types";
import {
API_VERSION,
OAUTH_AUTHORIZE_PATH,
OAUTH_TOKEN_PATH,
SITE_NAME,
SITE_URL,
} from "@/constants";
import { API_SCOPES, type ApiScope } from "@/lib/api/scopes";
// Static half of the OpenAPI document: everything not derived from the route table. Kept free of
// server-only imports so the contract can be asserted in a plain unit test.
export const API_SECURITY_SCHEME_BEARER = "apiKey";
export const API_SECURITY_SCHEME_OAUTH2 = "oauth2";
export const API_TAGS = {
account: "Account",
teams: "Teams",
mem
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key