136 lines · 4.7 KB
import { env } from "cloudflare:workers";

export const PAGES_LIMITS = {
  maxFiles: 5000,
  maxFileBytes: 25 * 1024 * 1024,
  maxTotalBytes: 512 * 1024 * 1024,
  maxArtifactBytes: 1024 * 1024 * 1024,
  deploysPerRepoPerHour: 30,
  uploadBatch: 100,
  historyLimit: 50,
} as const;

export type PagesEnvironment = "production" | "preview";
export type PagesSource = "branch" | "workflow";
export type DeploymentStatus = "queued" | "building" | "active" | "failed" | "superseded";

export type PagesSiteRow = {
  repo_id: string;
  source: PagesSource;
  branch: string;
  folder: string;
  artifact_name: string;
  spa: number;
  previews: number;
  custom_domain: string | null;
  custom_hostname_id: string | null;
  domain_status: string | null;
  domain_claimed_at: number | null;
  active_deployment_id: string | null;
  created_at: number;
  updated_at: number;
};

export type PagesDeploymentRow = {
  id: string;
  repo_id: string;
  environment: PagesEnvironment;
  pr_number: number | null;
  source: "branch" | "artifact";
  ref: string;