# airdress.thing.*

{/* Generated by scripts/generate-event-reference.mjs from https://schemas.airdress.co/operator/events/v1.json (operator v0.1.138).
    Do not edit by hand: run `pnpm generate:event-reference` and commit the result. */}

The events in the `airdress.thing` family. How to read a section, and what
each audience means, is on the [event reference](/events/) page.

## `airdress.thing.announce.drifted`

Owner info

A thing announced events or commands its `Thing` does not declare; the `AnnounceDrift` condition names them. Written on every reconcile while the drift stands, so off the bus.

**Audience: owner.** About the airdress as a whole. Only the owner receives it: the owner's devices and the owner's subscriptions.

**Where it goes**

- **The operator's journal**, as one log line at this level, and **the event log**, where `airdress events tail` reads it.
- **Subscriptions** that name it, within its audience.
- Not functions bound to this operator's events: it is kept off that path as too frequent or too internal. A subscription with a function target still receives it.

**Versions**

- Version 1: first carried by operator v0.1.138.

**Data**

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `thing` | string | yes |  |
| `undeclared` | integer (uint) | yes |  |

<details>
<summary>JSON Schema</summary>

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "A thing announced events or commands its `Thing` does not declare; the `AnnounceDrift` condition names them. Written on every reconcile while the drift stands, so off the bus.",
  "properties": {
    "thing": {
      "type": "string"
    },
    "undeclared": {
      "format": "uint",
      "minimum": 0,
      "type": "integer"
    }
  },
  "required": [
    "thing",
    "undeclared"
  ],
  "title": "ThingAnnounceDrifted",
  "type": "object"
}
```

</details>

## `airdress.thing.channel.closed`

Owner info Functions

A thing's command channel closed, with why and how long it lived.

**Audience: owner.** About the airdress as a whole. Only the owner receives it: the owner's devices and the owner's subscriptions.

**Where it goes**

- **The operator's journal**, as one log line at this level, and **the event log**, where `airdress events tail` reads it.
- **Subscriptions** that name it, within its audience.
- **Functions bound to this operator's events** (`source: operator`).

**Versions**

- Version 1: first carried by operator v0.1.138.

**Data**

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `lived_secs` | integer (uint64) | yes |  |
| `machine` | string (uuid) | yes |  |
| `reason` | string | yes |  |
| `session` | string (uuid) | yes |  |
| `thing` | string | yes |  |

<details>
<summary>JSON Schema</summary>

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "A thing's command channel closed, with why and how long it lived.",
  "properties": {
    "lived_secs": {
      "format": "uint64",
      "minimum": 0,
      "type": "integer"
    },
    "machine": {
      "format": "uuid",
      "type": "string"
    },
    "reason": {
      "type": "string"
    },
    "session": {
      "format": "uuid",
      "type": "string"
    },
    "thing": {
      "type": "string"
    }
  },
  "required": [
    "lived_secs",
    "machine",
    "reason",
    "session",
    "thing"
  ],
  "title": "ThingChannelClosed",
  "type": "object"
}
```

</details>

## `airdress.thing.channel.opened`

Owner info Functions

A thing's command channel opened; a previous one for the same machine, if any, was displaced.

**Audience: owner.** About the airdress as a whole. Only the owner receives it: the owner's devices and the owner's subscriptions.

**Where it goes**

- **The operator's journal**, as one log line at this level, and **the event log**, where `airdress events tail` reads it.
- **Subscriptions** that name it, within its audience.
- **Functions bound to this operator's events** (`source: operator`).

**Versions**

- Version 1: first carried by operator v0.1.138.

**Data**

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `machine` | string (uuid) | yes |  |
| `session` | string (uuid) | yes |  |
| `thing` | string | yes |  |

<details>
<summary>JSON Schema</summary>

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "A thing's command channel opened; a previous one for the same machine, if any, was displaced.",
  "properties": {
    "machine": {
      "format": "uuid",
      "type": "string"
    },
    "session": {
      "format": "uuid",
      "type": "string"
    },
    "thing": {
      "type": "string"
    }
  },
  "required": [
    "machine",
    "session",
    "thing"
  ],
  "title": "ThingChannelOpened",
  "type": "object"
}
```

</details>

## `airdress.thing.command.answered`

Owner info Functions

A thing answered a command, with its outcome and the time it says it spent. The result itself is not recorded.

**Audience: owner.** About the airdress as a whole. Only the owner receives it: the owner's devices and the owner's subscriptions.

**Where it goes**

- **The operator's journal**, as one log line at this level, and **the event log**, where `airdress events tail` reads it.
- **Subscriptions** that name it, within its audience.
- **Functions bound to this operator's events** (`source: operator`).

**Versions**

- Version 1: first carried by operator v0.1.138.

**Data**

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `command_id` | string (uuid) | yes |  |
| `device_ms` | number or null | no |  |
| `outcome` | string | yes |  |
| `thing` | string | yes |  |

<details>
<summary>JSON Schema</summary>

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "A thing answered a command, with its outcome and the time it says it spent. The result itself is not recorded.",
  "properties": {
    "command_id": {
      "format": "uuid",
      "type": "string"
    },
    "device_ms": {
      "format": "double",
      "type": [
        "number",
        "null"
      ]
    },
    "outcome": {
      "type": "string"
    },
    "thing": {
      "type": "string"
    }
  },
  "required": [
    "command_id",
    "outcome",
    "thing"
  ],
  "title": "ThingCommandAnswered",
  "type": "object"
}
```

</details>

## `airdress.thing.command.refused`

Owner info Functions

A command to a thing was refused before it was sent.

The thing cannot be reached, the command is not one it declares, its arguments are too large, it is rate limited, or a function asked for a command it is not granted (then `function` names the function).

**Audience: owner.** About the airdress as a whole. Only the owner receives it: the owner's devices and the owner's subscriptions.

**Where it goes**

- **The operator's journal**, as one log line at this level, and **the event log**, where `airdress events tail` reads it.
- **Subscriptions** that name it, within its audience.
- **Functions bound to this operator's events** (`source: operator`).

**Versions**

- Version 1: first carried by operator v0.1.138.

**Data**

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `command` | string | yes |  |
| `function` | string or null | no |  |
| `reason` | string | yes |  |
| `thing` | string | yes |  |

<details>
<summary>JSON Schema</summary>

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "A command to a thing was refused before it was sent.\n\nThe thing cannot be reached, the command is not one it declares, its arguments are too large, it is rate limited, or a function asked for a command it is not granted (then `function` names the function).",
  "properties": {
    "command": {
      "type": "string"
    },
    "function": {
      "type": [
        "string",
        "null"
      ]
    },
    "reason": {
      "type": "string"
    },
    "thing": {
      "type": "string"
    }
  },
  "required": [
    "command",
    "reason",
    "thing"
  ],
  "title": "ThingCommandRefused",
  "type": "object"
}
```

</details>

## `airdress.thing.command.result_unclaimed`

Owner info Functions

A thing answered a command nobody is waiting for any more.

**Audience: owner.** About the airdress as a whole. Only the owner receives it: the owner's devices and the owner's subscriptions.

**Where it goes**

- **The operator's journal**, as one log line at this level, and **the event log**, where `airdress events tail` reads it.
- **Subscriptions** that name it, within its audience.
- **Functions bound to this operator's events** (`source: operator`).

**Versions**

- Version 1: first carried by operator v0.1.138.

**Data**

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `command_id` | string (uuid) | yes |  |
| `thing` | string | yes |  |

<details>
<summary>JSON Schema</summary>

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "A thing answered a command nobody is waiting for any more.",
  "properties": {
    "command_id": {
      "format": "uuid",
      "type": "string"
    },
    "thing": {
      "type": "string"
    }
  },
  "required": [
    "command_id",
    "thing"
  ],
  "title": "ThingCommandResultUnclaimed",
  "type": "object"
}
```

</details>

## `airdress.thing.command.sent`

Owner info Functions

A command was sent to a thing, or put in its mailbox for its next poll (`mailed`). Its arguments are not recorded.

**Audience: owner.** About the airdress as a whole. Only the owner receives it: the owner's devices and the owner's subscriptions.

**Where it goes**

- **The operator's journal**, as one log line at this level, and **the event log**, where `airdress events tail` reads it.
- **Subscriptions** that name it, within its audience.
- **Functions bound to this operator's events** (`source: operator`).

**Versions**

- Version 1: first carried by operator v0.1.138.

**Data**

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `command` | string | yes |  |
| `command_id` | string (uuid) | yes |  |
| `function` | string | yes |  |
| `mailed` | boolean | yes |  |
| `thing` | string | yes |  |

<details>
<summary>JSON Schema</summary>

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "A command was sent to a thing, or put in its mailbox for its next poll (`mailed`). Its arguments are not recorded.",
  "properties": {
    "command": {
      "type": "string"
    },
    "command_id": {
      "format": "uuid",
      "type": "string"
    },
    "function": {
      "type": "string"
    },
    "mailed": {
      "type": "boolean"
    },
    "thing": {
      "type": "string"
    }
  },
  "required": [
    "command",
    "command_id",
    "function",
    "mailed",
    "thing"
  ],
  "title": "ThingCommandSent",
  "type": "object"
}
```

</details>

## `airdress.thing.command.timed_out`

Owner info Functions

A command to a thing was not answered in time, or a mailed command expired before its device polled. `delivered` says whether the device had acknowledged it.

**Audience: owner.** About the airdress as a whole. Only the owner receives it: the owner's devices and the owner's subscriptions.

**Where it goes**

- **The operator's journal**, as one log line at this level, and **the event log**, where `airdress events tail` reads it.
- **Subscriptions** that name it, within its audience.
- **Functions bound to this operator's events** (`source: operator`).

**Versions**

- Version 1: first carried by operator v0.1.138.

**Data**

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `command_id` | string (uuid) | yes |  |
| `delivered` | boolean | yes |  |
| `mailed` | boolean or null | no |  |
| `thing` | string | yes |  |

<details>
<summary>JSON Schema</summary>

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "A command to a thing was not answered in time, or a mailed command expired before its device polled. `delivered` says whether the device had acknowledged it.",
  "properties": {
    "command_id": {
      "format": "uuid",
      "type": "string"
    },
    "delivered": {
      "type": "boolean"
    },
    "mailed": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "thing": {
      "type": "string"
    }
  },
  "required": [
    "command_id",
    "delivered",
    "thing"
  ],
  "title": "ThingCommandTimedOut",
  "type": "object"
}
```

</details>

## `airdress.thing.deleted`

Owner info Functions

A `Thing` was deleted; its machine is no longer admitted.

**Audience: owner.** About the airdress as a whole. Only the owner receives it: the owner's devices and the owner's subscriptions.

**Where it goes**

- **The operator's journal**, as one log line at this level, and **the event log**, where `airdress events tail` reads it.
- **Subscriptions** that name it, within its audience.
- **Functions bound to this operator's events** (`source: operator`).

**Versions**

- Version 1: first carried by operator v0.1.138.

**Data**

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `thing` | string | yes |  |

<details>
<summary>JSON Schema</summary>

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "A `Thing` was deleted; its machine is no longer admitted.",
  "properties": {
    "thing": {
      "type": "string"
    }
  },
  "required": [
    "thing"
  ],
  "title": "ThingDeleted",
  "type": "object"
}
```

</details>

## `airdress.thing.events.dropped_on_device`

Owner info

A thing reported, in one batch, dropping events from its own queue before it could send them. One per batch, so off the bus.

**Audience: owner.** About the airdress as a whole. Only the owner receives it: the owner's devices and the owner's subscriptions.

**Where it goes**

- **The operator's journal**, as one log line at this level, and **the event log**, where `airdress events tail` reads it.
- **Subscriptions** that name it, within its audience.
- Not functions bound to this operator's events: it is kept off that path as too frequent or too internal. A subscription with a function target still receives it.

**Versions**

- Version 1: first carried by operator v0.1.138.

**Data**

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `dropped` | integer (uint64) | yes |  |
| `thing` | string | yes |  |

<details>
<summary>JSON Schema</summary>

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "A thing reported, in one batch, dropping events from its own queue before it could send them. One per batch, so off the bus.",
  "properties": {
    "dropped": {
      "format": "uint64",
      "minimum": 0,
      "type": "integer"
    },
    "thing": {
      "type": "string"
    }
  },
  "required": [
    "dropped",
    "thing"
  ],
  "title": "ThingEventsDroppedOnDevice",
  "type": "object"
}
```

</details>

## `airdress.thing.events.refused`

Owner info

Events in one batch from a thing were refused, counted by reason. What the events carried is not recorded. One per batch, so off the bus.

**Audience: owner.** About the airdress as a whole. Only the owner receives it: the owner's devices and the owner's subscriptions.

**Where it goes**

- **The operator's journal**, as one log line at this level, and **the event log**, where `airdress events tail` reads it.
- **Subscriptions** that name it, within its audience.
- Not functions bound to this operator's events: it is kept off that path as too frequent or too internal. A subscription with a function target still receives it.

**Versions**

- Version 1: first carried by operator v0.1.138.

**Data**

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `invalid_data` | integer (uint) | yes |  |
| `invalid_event` | integer (uint) | yes |  |
| `invalid_time` | integer (uint) | yes |  |
| `rate_limited` | integer (uint) | yes |  |
| `thing` | string | yes |  |
| `unknown_type` | integer (uint) | yes |  |

<details>
<summary>JSON Schema</summary>

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "Events in one batch from a thing were refused, counted by reason. What the events carried is not recorded. One per batch, so off the bus.",
  "properties": {
    "invalid_data": {
      "format": "uint",
      "minimum": 0,
      "type": "integer"
    },
    "invalid_event": {
      "format": "uint",
      "minimum": 0,
      "type": "integer"
    },
    "invalid_time": {
      "format": "uint",
      "minimum": 0,
      "type": "integer"
    },
    "rate_limited": {
      "format": "uint",
      "minimum": 0,
      "type": "integer"
    },
    "thing": {
      "type": "string"
    },
    "unknown_type": {
      "format": "uint",
      "minimum": 0,
      "type": "integer"
    }
  },
  "required": [
    "invalid_data",
    "invalid_event",
    "invalid_time",
    "rate_limited",
    "thing",
    "unknown_type"
  ],
  "title": "ThingEventsRefused",
  "type": "object"
}
```

</details>

## `airdress.thing.liveness.unavailable`

Owner warn Functions

Held thing channels could not be checked against machine revocation: the database did not answer. Logged once per failing stretch; a database that cannot answer closes nothing.

**Audience: owner.** About the airdress as a whole. Only the owner receives it: the owner's devices and the owner's subscriptions.

**Where it goes**

- **The operator's journal**, as one log line at this level, and **the event log**, where `airdress events tail` reads it.
- **Subscriptions** that name it, within its audience.
- **Functions bound to this operator's events** (`source: operator`).

**Versions**

- Version 1: first carried by operator v0.1.138.

**Data**

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `error` | string | yes |  |

<details>
<summary>JSON Schema</summary>

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "Held thing channels could not be checked against machine revocation: the database did not answer. Logged once per failing stretch; a database that cannot answer closes nothing.",
  "properties": {
    "error": {
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "title": "ThingLivenessUnavailable",
  "type": "object"
}
```

</details>

## `airdress.thing.request.refused`

Owner info Functions

A machine that is not linked as a Thing, or whose Thing is not enabled, asked for a thing route and was refused.

**Audience: owner.** About the airdress as a whole. Only the owner receives it: the owner's devices and the owner's subscriptions.

**Where it goes**

- **The operator's journal**, as one log line at this level, and **the event log**, where `airdress events tail` reads it.
- **Subscriptions** that name it, within its audience.
- **Functions bound to this operator's events** (`source: operator`).

**Versions**

- Version 1: first carried by operator v0.1.138.

**Data**

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `machine` | string (uuid) | yes |  |
| `reason` | string | yes |  |

<details>
<summary>JSON Schema</summary>

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "A machine that is not linked as a Thing, or whose Thing is not enabled, asked for a thing route and was refused.",
  "properties": {
    "machine": {
      "format": "uuid",
      "type": "string"
    },
    "reason": {
      "type": "string"
    }
  },
  "required": [
    "machine",
    "reason"
  ],
  "title": "ThingRequestRefused",
  "type": "object"
}
```

</details>