{
  "openapi": "3.1.1",
  "info": {
    "title": "Seafoam Labs Package Repository API",
    "description": "The read-only JSON API of this package repository: the searchable catalog,\npackage search and package details. Every route is anonymous and cached for\nabout 15 seconds, and every error is an RFC 9457 problem-details document\nrather than the site's HTML page.\n\nRequests are limited to 60 per minute per address; a limited request says\nwhen its window resets in `Retry-After`.\n\nURLs in a response are absolute when a mirror serves the packages and\nsite-relative otherwise, so a relative one resolves against the origin it\ncame from.",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://repo.seafoam-labs.org/"
    }
  ],
  "paths": {
    "/api/v1/repositories": {
      "get": {
        "tags": [
          "repositories"
        ],
        "summary": "List repositories",
        "description": "The id, name, architectures, signing-key fingerprint and key URLs of every searchable repository, plus which one is the default, how many packages it holds and when the index last loaded.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PublicRepositorySummary"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/packages": {
      "get": {
        "tags": [
          "packages"
        ],
        "summary": "Search packages",
        "description": "Every published package, filtered and ordered by the query parameters below. The search is unbounded: this site's pages window it, this route does not. Each row carries a downloadUrl and the repository architecture it was indexed under, which is not the same as an `any` package's own.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Case-insensitive substring match over name, description, provides and groups.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "repository",
            "in": "query",
            "description": "A repository id from GET /api/v1/repositories; every repository by default.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "arch",
            "in": "query",
            "description": "A repository architecture from GET /api/v1/repositories; every architecture by default.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "One of name, namedesc, version, builddate, builddateasc, size, sizeasc; an unrecognized value falls back to name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "query",
            "description": "Exact package name, unlike the substring q.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "group",
            "in": "query",
            "description": "Exact group name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "signed",
            "in": "query",
            "description": "true or false; any other value is a 400.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PublicPackageSummary"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/repositories/{repository}/packages/{arch}/{name}": {
      "get": {
        "tags": [
          "packages"
        ],
        "summary": "Package details",
        "description": "The whole indexed entry, its dependencies and file list, plus its downloadUrl and the detailUrl of this site's page for it.",
        "parameters": [
          {
            "name": "repository",
            "in": "path",
            "description": "A repository id from GET /api/v1/repositories.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "arch",
            "in": "path",
            "description": "Either the repository architecture the package was indexed under or the package's own.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "path",
            "description": "The exact package name.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPackageDetail"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/packages/{arch}/{name}": {
      "get": {
        "tags": [
          "packages"
        ],
        "summary": "Package details in the default repository",
        "description": "The same lookup as the repository-qualified route, against the default repository only, so a package published anywhere else is a 404 here.",
        "parameters": [
          {
            "name": "arch",
            "in": "path",
            "description": "Either the repository architecture the package was indexed under or the package's own.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "path",
            "description": "The exact package name.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPackageDetail"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "instance": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PublicPackageDetail": {
        "required": [
          "repositoryId",
          "repo",
          "architecture",
          "repoArchitecture",
          "name",
          "version",
          "licenses",
          "groups",
          "compressedSize",
          "installedSize",
          "hasPgpSignature",
          "depends",
          "makeDepends",
          "checkDepends",
          "optDepends",
          "conflicts",
          "provides",
          "replaces",
          "files",
          "requiredBy",
          "downloadUrl",
          "detailUrl"
        ],
        "type": "object",
        "properties": {
          "repositoryId": {
            "type": "string"
          },
          "repo": {
            "type": "string"
          },
          "architecture": {
            "type": "string"
          },
          "repoArchitecture": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "base": {
            "type": [
              "null",
              "string"
            ]
          },
          "version": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "url": {
            "type": [
              "null",
              "string"
            ]
          },
          "packager": {
            "type": [
              "null",
              "string"
            ]
          },
          "licenses": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "groups": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "compressedSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "installedSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "md5Sum": {
            "type": [
              "null",
              "string"
            ]
          },
          "sha256Sum": {
            "type": [
              "null",
              "string"
            ]
          },
          "hasPgpSignature": {
            "type": "boolean"
          },
          "buildDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "fileName": {
            "type": [
              "null",
              "string"
            ]
          },
          "depends": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "makeDepends": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "checkDepends": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "optDepends": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "conflicts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "provides": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "replaces": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "files": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "requiredBy": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "downloadUrl": {
            "type": "string"
          },
          "detailUrl": {
            "type": "string",
            "description": "This site's HTML page for the package, site-relative."
          }
        }
      },
      "PublicPackageSummary": {
        "required": [
          "repositoryId",
          "repo",
          "name",
          "version",
          "architecture",
          "repoArchitecture",
          "compressedSize",
          "installedSize",
          "licenses",
          "groups",
          "provides",
          "hasPgpSignature",
          "downloadUrl"
        ],
        "type": "object",
        "properties": {
          "repositoryId": {
            "type": "string"
          },
          "repo": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "architecture": {
            "type": "string",
            "description": "The package's own %ARCH%, which is not the directory it is served from when it is 'any': downloadUrl is built from repoArchitecture."
          },
          "repoArchitecture": {
            "type": "string",
            "description": "The repository architecture this package was indexed under. repo-add files an 'any' package under every one, so a path built from architecture alone points at a directory that does not exist."
          },
          "compressedSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "installedSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "buildDate": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "fileName": {
            "type": [
              "null",
              "string"
            ]
          },
          "url": {
            "type": [
              "null",
              "string"
            ]
          },
          "packager": {
            "type": [
              "null",
              "string"
            ]
          },
          "licenses": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "groups": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "provides": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sha256Sum": {
            "type": [
              "null",
              "string"
            ]
          },
          "hasPgpSignature": {
            "type": "boolean"
          },
          "downloadUrl": {
            "type": "string",
            "description": "Ready-made download: server root, repository architecture and file name."
          }
        }
      },
      "PublicRepositorySummary": {
        "required": [
          "id",
          "name",
          "architectures",
          "isDefault",
          "packageCount",
          "lastIndexed",
          "serverUrl",
          "keyserver"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "architectures": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "gpgKeyFingerprint": {
            "type": [
              "null",
              "string"
            ]
          },
          "publicKeyUrl": {
            "type": [
              "null",
              "string"
            ],
            "description": "This site's armored-key endpoint, site-relative because only this app serves it. armoredKeyUrl is the one clients fetch."
          },
          "isDefault": {
            "type": "boolean"
          },
          "packageCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "lastIndexed": {
            "type": "string",
            "format": "date-time"
          },
          "serverUrl": {
            "type": "string",
            "description": "The Server = line the setup page prints, carrying the $arch placeholder the package manager substitutes. Absolute when a mirror serves this repository."
          },
          "armoredKeyUrl": {
            "type": [
              "null",
              "string"
            ],
            "description": "Where a client fetches the armored signing key: the mirror's copy when this repository's export is synced there, otherwise this site's endpoint."
          },
          "keyserver": {
            "type": "string"
          },
          "syncPrefix": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "repositories"
    },
    {
      "name": "packages"
    }
  ]
}