# airdress.event_subscription.*

{/* 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.event_subscription` family. How to read a section, and what
each audience means, is on the [event reference](/events/) page.

## `airdress.event_subscription.applied`

Owner info Functions

An `EventSubscription` was applied: created, changed, or re-applied (which also re-enables one disabled after failures).

**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.133.

**Data**

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `owner_kind` | string | yes | Whose it is: `owner`, `machine` or `sub_user`. |
| `subscription` | string | yes | The subscription's name. |
| `target` | string | yes | The target's kind: `http` or `function`. |

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

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "An `EventSubscription` was applied: created, changed, or re-applied (which also re-enables one disabled after failures).",
  "properties": {
    "owner_kind": {
      "description": "Whose it is: `owner`, `machine` or `sub_user`.",
      "type": "string"
    },
    "subscription": {
      "description": "The subscription's name.",
      "type": "string"
    },
    "target": {
      "description": "The target's kind: `http` or `function`.",
      "type": "string"
    }
  },
  "required": [
    "owner_kind",
    "subscription",
    "target"
  ],
  "title": "SubscriptionApplied",
  "type": "object"
}
```

</details>

## `airdress.event_subscription.delivery_abandoned`

Owner warn Functions

Deliveries were given up without being delivered: the event log hit its size cap and the events they pointed at were swept. One per subscription per sweep.

**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.133.

**Data**

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `count` | integer (uint64) | yes | How many deliveries were abandoned. |
| `reason` | string | yes | Why: `retention`. |
| `subscription` | string | yes | The subscription's name. |

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

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "Deliveries were given up without being delivered: the event log hit its size cap and the events they pointed at were swept. One per subscription per sweep.",
  "properties": {
    "count": {
      "description": "How many deliveries were abandoned.",
      "format": "uint64",
      "minimum": 0,
      "type": "integer"
    },
    "reason": {
      "description": "Why: `retention`.",
      "type": "string"
    },
    "subscription": {
      "description": "The subscription's name.",
      "type": "string"
    }
  },
  "required": [
    "count",
    "reason",
    "subscription"
  ],
  "title": "DeliveryAbandoned",
  "type": "object"
}
```

</details>

## `airdress.event_subscription.delivery_failed`

Owner info

One delivery attempt failed. Never delivered to the subscription it is about.

**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.133.

**Data**

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `abandoned` | boolean | yes | Whether this was the last attempt. |
| `attempt` | integer (uint32) | yes | Which attempt this was, from 1. |
| `error_class` | string | yes | What went wrong when it did not answer, or answered wrongly: `status`, `timeout`, `connect`, `address_refused`, `signing`, `function_unavailable`, `function_failed`, … |
| `event_id` | string (uuid) | yes | The event that was being delivered. |
| `status` | integer or null | no | The receiver's status code, when it answered. |
| `subscription` | string | yes | The subscription's name. |

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

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "One delivery attempt failed. Never delivered to the subscription it is about.",
  "properties": {
    "abandoned": {
      "description": "Whether this was the last attempt.",
      "type": "boolean"
    },
    "attempt": {
      "description": "Which attempt this was, from 1.",
      "format": "uint32",
      "minimum": 0,
      "type": "integer"
    },
    "error_class": {
      "description": "What went wrong when it did not answer, or answered wrongly: `status`, `timeout`, `connect`, `address_refused`, `signing`, `function_unavailable`, `function_failed`, …",
      "type": "string"
    },
    "event_id": {
      "description": "The event that was being delivered.",
      "format": "uuid",
      "type": "string"
    },
    "status": {
      "description": "The receiver's status code, when it answered.",
      "format": "uint16",
      "minimum": 0,
      "type": [
        "integer",
        "null"
      ]
    },
    "subscription": {
      "description": "The subscription's name.",
      "type": "string"
    }
  },
  "required": [
    "abandoned",
    "attempt",
    "error_class",
    "event_id",
    "subscription"
  ],
  "title": "DeliveryFailed",
  "type": "object"
}
```

</details>

## `airdress.event_subscription.disabled`

Owner warn Functions

A subscription stopped delivering: every attempt failed for five days. Re-applying it resumes the queued backlog.

**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.133.

**Data**

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `consecutive_failures` | integer (uint32) | yes | Failed attempts since the last success. |
| `reason` | string | yes | Why: `DisabledAfterFailures`. |
| `subscription` | string | yes | The subscription's name. |

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

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "A subscription stopped delivering: every attempt failed for five days. Re-applying it resumes the queued backlog.",
  "properties": {
    "consecutive_failures": {
      "description": "Failed attempts since the last success.",
      "format": "uint32",
      "minimum": 0,
      "type": "integer"
    },
    "reason": {
      "description": "Why: `DisabledAfterFailures`.",
      "type": "string"
    },
    "subscription": {
      "description": "The subscription's name.",
      "type": "string"
    }
  },
  "required": [
    "consecutive_failures",
    "reason",
    "subscription"
  ],
  "title": "SubscriptionDisabled",
  "type": "object"
}
```

</details>

## `airdress.event_subscription.owner_disabled`

The person it concerns warn App stream

The owner switched a person's subscription off. Told to that person; the owner learns nothing of where it pointed.

**Audience: the person it concerns.** About one person on the airdress. It reaches only that person: their own devices and subscriptions they made themselves. The owner's subscriptions never receive another person's events.

**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.
- **The app's event stream**, as `event_subscription_block_changed`: devices it concerns hear of it at once.
- Not functions bound to this operator's events: functions act for the owner, and this event is about someone else.

**Versions**

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

**Data**

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `airdress` | string | yes | The stream it is addressed to: the person's airdress. |
| `at` | string | yes |  |
| `blocked` | boolean | yes | Always `true`: the frame carries the state, not the transition. |
| `principal_id` | string (uuid) | yes | Whose subscription it is. |
| `subscription` | string | yes | The subscription's name. |

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

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "The owner switched a person's subscription off. Told to that person; the owner learns nothing of where it pointed.",
  "properties": {
    "airdress": {
      "description": "The stream it is addressed to: the person's airdress.",
      "type": "string"
    },
    "at": {
      "type": "string"
    },
    "blocked": {
      "description": "Always `true`: the frame carries the state, not the transition.",
      "type": "boolean"
    },
    "principal_id": {
      "description": "Whose subscription it is.",
      "format": "uuid",
      "type": "string"
    },
    "subscription": {
      "description": "The subscription's name.",
      "type": "string"
    }
  },
  "required": [
    "airdress",
    "at",
    "blocked",
    "principal_id",
    "subscription"
  ],
  "title": "OwnerDisabled",
  "type": "object"
}
```

</details>

## `airdress.event_subscription.owner_lifted`

The person it concerns info App stream

The owner lifted their disable. Lifting does not re-enable a subscription the person disabled themselves.

**Audience: the person it concerns.** About one person on the airdress. It reaches only that person: their own devices and subscriptions they made themselves. The owner's subscriptions never receive another person's events.

**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.
- **The app's event stream**, as `event_subscription_block_changed`: devices it concerns hear of it at once.
- Not functions bound to this operator's events: functions act for the owner, and this event is about someone else.

**Versions**

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

**Data**

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `airdress` | string | yes | The stream it is addressed to: the person's airdress. |
| `at` | string | yes |  |
| `blocked` | boolean | yes | Always `false`. |
| `principal_id` | string (uuid) | yes | Whose subscription it is. |
| `subscription` | string | yes | The subscription's name. |

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

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "The owner lifted their disable. Lifting does not re-enable a subscription the person disabled themselves.",
  "properties": {
    "airdress": {
      "description": "The stream it is addressed to: the person's airdress.",
      "type": "string"
    },
    "at": {
      "type": "string"
    },
    "blocked": {
      "description": "Always `false`.",
      "type": "boolean"
    },
    "principal_id": {
      "description": "Whose subscription it is.",
      "format": "uuid",
      "type": "string"
    },
    "subscription": {
      "description": "The subscription's name.",
      "type": "string"
    }
  },
  "required": [
    "airdress",
    "at",
    "blocked",
    "principal_id",
    "subscription"
  ],
  "title": "OwnerLifted",
  "type": "object"
}
```

</details>

## `airdress.event_subscription.test.sent`

The person it concerns info

A synthetic event, sent on request to check a subscription end to end.

**Audience: the person it concerns.** About one person on the airdress. It reaches only that person: their own devices and subscriptions they made themselves. The owner's subscriptions never receive another person's events.

**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: functions act for the owner, and this event is about someone else.

**Versions**

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

**Data**

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `principal_id` | string (uuid) | yes | Who asked for it. |
| `subscription` | string | yes | The subscription it was sent to. |

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

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "A synthetic event, sent on request to check a subscription end to end.",
  "properties": {
    "principal_id": {
      "description": "Who asked for it.",
      "format": "uuid",
      "type": "string"
    },
    "subscription": {
      "description": "The subscription it was sent to.",
      "type": "string"
    }
  },
  "required": [
    "principal_id",
    "subscription"
  ],
  "title": "TestSent",
  "type": "object"
}
```

</details>