# dev.cocore.defs

> Published by [cocore.dev](https://lexicon.garden/identity/did:plc:5quuhkmwe2q4k3azfsgg7kdz)

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:5quuhkmwe2q4k3azfsgg7kdz/dev.cocore.defs)
- [Documentation](https://lexicon.garden/lexicon/did:plc:5quuhkmwe2q4k3azfsgg7kdz/dev.cocore.defs/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:5quuhkmwe2q4k3azfsgg7kdz/dev.cocore.defs/examples)

## Definitions

### `dev.cocore.defs#activityStat`

**Type**: `object`

Request + token counts within a single time window.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `tokens` | `integer` | Yes |  |
| `requests` | `integer` | Yes |  |

### `dev.cocore.defs#indexedRecord`

**Type**: `object`

An AT Protocol record as indexed by the AppView from the firehose. The AppView is a cache; the record on the provider's PDS remains the source of truth. `body` is the raw lexicon record JSON for the record at `uri`.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cid` | `string` (cid) | Yes |  |
| `uri` | `string` (at-uri) | Yes |  |
| `body` | `unknown` | Yes | The lexicon record JSON. Validate it against the NSID in `collection`. |
| `repo` | `string` (did) | Yes |  |
| `rkey` | `string` | Yes |  |
| `indexedAt` | `string` (datetime) | No |  |
| `collection` | `string` (nsid) | Yes |  |

### `dev.cocore.defs#verifyFinding`

**Type**: `object`

A single structural, cryptographic, or hardware-attestation finding produced while verifying a record. A finding with severity `error` means the verification failed.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `code` | `string` | Yes |  |
| `message` | `string` | Yes |  |
| `severity` | `string` | Yes |  |

### `dev.cocore.defs#activityWindows`

**Type**: `object`

Activity rolled up across the four standard windows: last hour, day (24h), week (7d), and month (30d).

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `day` | `ref` → `dev.cocore.defs#activityStat` | Yes |  |
| `hour` | `ref` → `dev.cocore.defs#activityStat` | Yes |  |
| `week` | `ref` → `dev.cocore.defs#activityStat` | Yes |  |
| `month` | `ref` → `dev.cocore.defs#activityStat` | Yes |  |

## Raw Schema

```json
{
  "id": "dev.cocore.defs",
  "defs": {
    "activityStat": {
      "type": "object",
      "required": [
        "requests",
        "tokens"
      ],
      "properties": {
        "tokens": {
          "type": "integer"
        },
        "requests": {
          "type": "integer"
        }
      },
      "description": "Request + token counts within a single time window."
    },
    "indexedRecord": {
      "type": "object",
      "required": [
        "uri",
        "cid",
        "collection",
        "repo",
        "rkey",
        "body"
      ],
      "properties": {
        "cid": {
          "type": "string",
          "format": "cid"
        },
        "uri": {
          "type": "string",
          "format": "at-uri"
        },
        "body": {
          "type": "unknown",
          "description": "The lexicon record JSON. Validate it against the NSID in `collection`."
        },
        "repo": {
          "type": "string",
          "format": "did"
        },
        "rkey": {
          "type": "string"
        },
        "indexedAt": {
          "type": "string",
          "format": "datetime"
        },
        "collection": {
          "type": "string",
          "format": "nsid"
        }
      },
      "description": "An AT Protocol record as indexed by the AppView from the firehose. The AppView is a cache; the record on the provider's PDS remains the source of truth. `body` is the raw lexicon record JSON for the record at `uri`."
    },
    "verifyFinding": {
      "type": "object",
      "required": [
        "severity",
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "severity": {
          "enum": [
            "error",
            "warning",
            "info"
          ],
          "type": "string"
        }
      },
      "description": "A single structural, cryptographic, or hardware-attestation finding produced while verifying a record. A finding with severity `error` means the verification failed."
    },
    "activityWindows": {
      "type": "object",
      "required": [
        "hour",
        "day",
        "week",
        "month"
      ],
      "properties": {
        "day": {
          "ref": "dev.cocore.defs#activityStat",
          "type": "ref"
        },
        "hour": {
          "ref": "dev.cocore.defs#activityStat",
          "type": "ref"
        },
        "week": {
          "ref": "dev.cocore.defs#activityStat",
          "type": "ref"
        },
        "month": {
          "ref": "dev.cocore.defs#activityStat",
          "type": "ref"
        }
      },
      "description": "Activity rolled up across the four standard windows: last hour, day (24h), week (7d), and month (30d)."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
