# org.cairnsproto.draft.source

> A content-addressed input. Anyone may publish one; records with the same hash name the same source.

- Kind: record
- Record key: tid
- Authority: draft.cairnsproto.org
- Lexicon: 1
- Published by [cairnsproto.org](https://lexicon.garden/identity/did:plc:np7ezqujtsry4bkogisaabul), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:np7ezqujtsry4bkogisaabul/org.cairnsproto.draft.source)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:np7ezqujtsry4bkogisaabul/org.cairnsproto.draft.source/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:np7ezqujtsry4bkogisaabul/org.cairnsproto.draft.source/analytics)

## Record (`org.cairnsproto.draft.source`)

Type: record · key tid

### Properties

- `createdAt` (string · datetime, required)
- `derivedFrom` (ref)
  - Reference: `#derivation`
- `git` (ref): A published state of an official repo. The hash alg is git-sha1 or git-sha256.
  - Reference: `#gitState`
- `hash` (ref, required)
  - Reference: `org.cairnsproto.draft.defs#hash`
- `license` (string): SPDX expression or URL: the source's own rights, which the project's output license must fit.
  - Constraints: maxLength: 512
- `mimeType` (string)
  - Constraints: maxLength: 256
- `size` (integer)
  - Constraints: minimum: 0
- `urls` (array): Where to fetch. The hash is the identity.
  - Constraints: maxLength: 32
  - `items` (string · uri)

## #derivation (`org.cairnsproto.draft.source#derivation`)

Type: object

This source is the output of running a transform record on another source.

### Properties

- `hash` (ref, required)
  - Reference: `org.cairnsproto.draft.defs#hash`
- `transform` (ref, required): The transform record that produced it.
  - Reference: `com.atproto.repo.strongRef`

## #gitState (`org.cairnsproto.draft.source#gitState`)

Type: object

### Properties

- `commit` (string, required): Full commit hash.
  - Constraints: minLength: 40, maxLength: 64
- `repo` (string, required): Git URL.
  - Constraints: maxLength: 2048

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "derivation": {
      "description": "This source is the output of running a transform record on another source.",
      "properties": {
        "hash": {
          "ref": "org.cairnsproto.draft.defs#hash",
          "type": "ref"
        },
        "transform": {
          "description": "The transform record that produced it.",
          "ref": "com.atproto.repo.strongRef",
          "type": "ref"
        }
      },
      "required": [
        "hash",
        "transform"
      ],
      "type": "object"
    },
    "gitState": {
      "properties": {
        "commit": {
          "description": "Full commit hash.",
          "maxLength": 64,
          "minLength": 40,
          "type": "string"
        },
        "repo": {
          "description": "Git URL.",
          "maxLength": 2048,
          "type": "string"
        }
      },
      "required": [
        "repo",
        "commit"
      ],
      "type": "object"
    },
    "main": {
      "description": "A content-addressed input. Anyone may publish one; records with the same hash name the same source.",
      "key": "tid",
      "record": {
        "properties": {
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "derivedFrom": {
            "ref": "#derivation",
            "type": "ref"
          },
          "git": {
            "description": "A published state of an official repo. The hash alg is git-sha1 or git-sha256.",
            "ref": "#gitState",
            "type": "ref"
          },
          "hash": {
            "ref": "org.cairnsproto.draft.defs#hash",
            "type": "ref"
          },
          "license": {
            "description": "SPDX expression or URL: the source's own rights, which the project's output license must fit.",
            "maxLength": 512,
            "type": "string"
          },
          "mimeType": {
            "maxLength": 256,
            "type": "string"
          },
          "size": {
            "minimum": 0,
            "type": "integer"
          },
          "urls": {
            "description": "Where to fetch. The hash is the identity.",
            "items": {
              "format": "uri",
              "type": "string"
            },
            "maxLength": 32,
            "type": "array"
          }
        },
        "required": [
          "hash",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "org.cairnsproto.draft.source",
  "lexicon": 1
}
```
