# dev.knotless.site

> Kept in the repository owner's account, keyed by the `key` of the dev.knotless.repo whose site it is, so a repository has one site. Each deploy replaces it, and the blobs only the old one named are freed. Deleting it takes the site down. Readers check every file against its `sha256`.

- Kind: record
- Record key: tid
- Authority: knotless.dev
- Lexicon: 1
- Published by [lexicons.knotless.dev](https://lexicon.garden/identity/did:plc:yqsg7znbbhfmj3a2nrpnaerk), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.site)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.site/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.site/analytics)

## Record (`dev.knotless.site`)

Type: record · key tid

### Properties

- `check` (string · at-uri): The dev.knotless.check, in its runner's account, of the run that built and deployed it. A reader trusts it only from a runner the repository names, and only once it has passed at `commit`.
- `commit` (string): The hex object ID of the commit the files were built from.
  - Constraints: minLength: 40, maxLength: 64
- `createdAt` (string · datetime, required): When this deploy was made.
- `fallback` (string): The path of a file in `files` served, with status 200, for a page no file has, as a single-page app routes in the browser: a request asking for `text/html`, or for a path whose last segment has no extension. Taken before `notFound`; anything else missing gets `notFound`.
  - Constraints: minLength: 1, maxLength: 512
- `files` (array, required): What the site serves, by distinct paths.
  - Constraints: minLength: 1, maxLength: 2000
  - `items` (ref)
    - Reference: `#file`
- `notFound` (string): The path of a file in `files` served, with status 404, for a path no file has.
  - Constraints: minLength: 1, maxLength: 512

## #file (`dev.knotless.site#file`)

Type: object

One file of a site.

### Properties

- `contentType` (string): The `Content-Type` it is served with, such as `text/html; charset=utf-8`, or else the type its path's extension names. Its blobs are `application/octet-stream` whatever it holds.
  - Constraints: minLength: 1, maxLength: 255
- `parts` (array, required): The file, split over blobs in order, each no larger than its PDS takes. None for an empty file.
  - Constraints: maxLength: 1000
  - `items` (ref)
    - Reference: `#part`
- `path` (string, required): Where it is served under the site's root: `/`-separated, with no leading `/` and no `.` or `..` segment. `x/index.html` is served at `x/` too.
  - Constraints: minLength: 1, maxLength: 512
- `sha256` (string, required): The lowercase hex SHA-256 of the file.
  - Constraints: minLength: 64, maxLength: 64
- `size` (integer, required): Bytes in the file.
  - Constraints: minimum: 0

## #part (`dev.knotless.site#part`)

Type: object

One blob of a file, in order.

### Properties

- `blob` (blob, required)
  - Constraints: accept: application/octet-stream

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "file": {
      "description": "One file of a site.",
      "properties": {
        "contentType": {
          "description": "The `Content-Type` it is served with, such as `text/html; charset=utf-8`, or else the type its path's extension names. Its blobs are `application/octet-stream` whatever it holds.",
          "maxLength": 255,
          "minLength": 1,
          "type": "string"
        },
        "parts": {
          "description": "The file, split over blobs in order, each no larger than its PDS takes. None for an empty file.",
          "items": {
            "ref": "#part",
            "type": "ref"
          },
          "maxLength": 1000,
          "type": "array"
        },
        "path": {
          "description": "Where it is served under the site's root: `/`-separated, with no leading `/` and no `.` or `..` segment. `x/index.html` is served at `x/` too.",
          "maxLength": 512,
          "minLength": 1,
          "type": "string"
        },
        "sha256": {
          "description": "The lowercase hex SHA-256 of the file.",
          "maxLength": 64,
          "minLength": 64,
          "type": "string"
        },
        "size": {
          "description": "Bytes in the file.",
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "path",
        "size",
        "sha256",
        "parts"
      ],
      "type": "object"
    },
    "main": {
      "description": "Kept in the repository owner's account, keyed by the `key` of the dev.knotless.repo whose site it is, so a repository has one site. Each deploy replaces it, and the blobs only the old one named are freed. Deleting it takes the site down. Readers check every file against its `sha256`.",
      "key": "tid",
      "record": {
        "properties": {
          "check": {
            "description": "The dev.knotless.check, in its runner's account, of the run that built and deployed it. A reader trusts it only from a runner the repository names, and only once it has passed at `commit`.",
            "format": "at-uri",
            "type": "string"
          },
          "commit": {
            "description": "The hex object ID of the commit the files were built from.",
            "maxLength": 64,
            "minLength": 40,
            "type": "string"
          },
          "createdAt": {
            "description": "When this deploy was made.",
            "format": "datetime",
            "type": "string"
          },
          "fallback": {
            "description": "The path of a file in `files` served, with status 200, for a page no file has, as a single-page app routes in the browser: a request asking for `text/html`, or for a path whose last segment has no extension. Taken before `notFound`; anything else missing gets `notFound`.",
            "maxLength": 512,
            "minLength": 1,
            "type": "string"
          },
          "files": {
            "description": "What the site serves, by distinct paths.",
            "items": {
              "ref": "#file",
              "type": "ref"
            },
            "maxLength": 2000,
            "minLength": 1,
            "type": "array"
          },
          "notFound": {
            "description": "The path of a file in `files` served, with status 404, for a path no file has.",
            "maxLength": 512,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "files",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "part": {
      "description": "One blob of a file, in order.",
      "properties": {
        "blob": {
          "accept": [
            "application/octet-stream"
          ],
          "type": "blob"
        }
      },
      "required": [
        "blob"
      ],
      "type": "object"
    }
  },
  "description": "A repository's website: the static files served at `https://<owner>.knotless.page/<repo>/`, and the commit they were built from.",
  "id": "dev.knotless.site",
  "lexicon": 1
}
```
