# dev.knotless.compactRepo

> Published by [lexicons.knotless.dev](https://lexicon.garden/identity/did:plc:yqsg7znbbhfmj3a2nrpnaerk)

✓ This is the authoritative definition for this NSID.

## Description

Folds a repository's packs into one.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.compactRepo)
- [Documentation](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.compactRepo/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.compactRepo/examples)

## Definitions

### `dev.knotless.compactRepo`

**Type**: `procedure`

Repacks what the repository's refs reach into one dev.knotless.pack and deletes the packs it replaces, as `knotless compact` does, with claims a day old. Packs younger than the grace period stay. Only its owner, logged in to this appview's web pages, can: the appview writes with the session it keeps for that account, which the pages' session cookie names.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `repo` | `string` (at-uri) | Yes | The repository's dev.knotless.repo record, as dev.knotless.getRepo takes it. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `claims` | `integer` | Yes | How many old claims were dropped. |
| `folded` | `integer` | Yes | How many of them were folded into one. |
| `packs` | `integer` | Yes | How many packs it had. |

#### Errors

- **NotFound**: No such repository.
- **AuthenticationRequired**: No account is logged in to the pages, or its session has ended.
- **Forbidden**: The account logged in is not the repository's owner.

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Repacks what the repository's refs reach into one dev.knotless.pack and deletes the packs it replaces, as `knotless compact` does, with claims a day old. Packs younger than the grace period stay. Only its owner, logged in to this appview's web pages, can: the appview writes with the session it keeps for that account, which the pages' session cookie names.",
      "errors": [
        {
          "description": "No such repository.",
          "name": "NotFound"
        },
        {
          "description": "No account is logged in to the pages, or its session has ended.",
          "name": "AuthenticationRequired"
        },
        {
          "description": "The account logged in is not the repository's owner.",
          "name": "Forbidden"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "repo": {
              "description": "The repository's dev.knotless.repo record, as dev.knotless.getRepo takes it.",
              "format": "at-uri",
              "type": "string"
            }
          },
          "required": [
            "repo"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "claims": {
              "description": "How many old claims were dropped.",
              "minimum": 0,
              "type": "integer"
            },
            "folded": {
              "description": "How many of them were folded into one.",
              "minimum": 0,
              "type": "integer"
            },
            "packs": {
              "description": "How many packs it had.",
              "minimum": 0,
              "type": "integer"
            }
          },
          "required": [
            "packs",
            "folded",
            "claims"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "description": "Folds a repository's packs into one.",
  "id": "dev.knotless.compactRepo",
  "lexicon": 1
}
```
