# Hook power (test fixture)

addons.desc.integration.hooks This is a **test fixture** used by the integration tests; it is not offered in the marketplace.

| Field | Value |
|---|---|
| Addon id | `integration-hooks` |
| Kind | `integration` |
| Provides | `hooks` |
| Engine | `wasm` |
| ABI | `0.4.0` |
| Version | 0.1.0 |
| Author | MythicalSystems |
| Source | `extensions/addons/fixture-hooks` |
| Permissions (shown at install) | none |

## Capabilities

| Capability | Value |
|---|---|
| [`filter_points`](capabilities.md) | `integration-hooks:greeting` |
| [`filters`](capabilities.md) | `[{"name":"catalog.public","priority":10},{"name":"invoice.view"},{"name":"integration-hooks:greeting"}]` |
| [`hooks`](capabilities.md) | `[{"event":"before:PUT /api/v1/client/profile","fail_open":true,"timeout_ms":150},{"event":"ticket.before_open"},{"event":"ticket.before_reply"}]` |
| [`kv`](capabilities.md) | true |
| [`mixins`](capabilities.md) | `[{"at":"around","target":"fn ticket.open","timeout_ms":500}]` |
| [`routes`](capabilities.md) | `[{"access":"client","method":"GET","path":"/state"},{"access":"client","method":"GET","path":"/greeting"}]` |
| [`ui`](capabilities.md) | `override` |

## Events and hooks

| What | Value |
|---|---|
| Listens to (`events`) | none |
| Hooks | `before:PUT /api/v1/client/profile`, `ticket.before_open`, `ticket.before_reply` |
| Emits | none |
| Mixins | `fn ticket.open` (around) |
| Filters | `catalog.public`, `invoice.view`, `integration-hooks:greeting` |
| Scheduled jobs | none |

## Settings and secrets

No admin settings are declared in `addon.json` or in the source.

Secrets (stored encrypted, never returned by the API): none.

Outbound HTTP allowed to: none. `$server` is the hostname of the server configured for the product, `$setting:<key>` the host of that setting.

## HTTP routes

Mounted under `/api/v1/addons/integration-hooks/`.

| Method | Path | Access | Permission |
|---|---|---|---|
| GET | `/state` | client | - |
| GET | `/greeting` | client | - |

## UI

Pages: `override` (client). Slots: none. See [Widgets and slots](widgets.md).

## addon.json

_extensions/addons/fixture-hooks/addon.json_

```json
{
  "abi": "0.4.0",
  "author": "MythicalSystems",
  "capabilities": {
    "filter_points": [
      "integration-hooks:greeting"
    ],
    "filters": [
      {
        "name": "catalog.public",
        "priority": 10
      },
      {
        "name": "invoice.view"
      },
      {
        "name": "integration-hooks:greeting"
      }
    ],
    "hooks": [
      {
        "event": "before:PUT /api/v1/client/profile",
        "fail_open": true,
        "timeout_ms": 150
      },
      {
        "event": "ticket.before_open"
      },
      {
        "event": "ticket.before_reply"
      }
    ],
    "kv": true,
    "mixins": [
      {
        "at": "around",
        "target": "fn ticket.open",
        "timeout_ms": 500
      }
    ],
    "routes": [
      {
        "access": "client",
        "method": "GET",
        "path": "/state"
      },
      {
        "access": "client",
        "method": "GET",
        "path": "/greeting"
      }
    ],
    "ui": [
      "override"
    ]
  },
  "description": "addons.desc.integration.hooks",
  "engine": "wasm",
  "id": "integration-hooks",
  "kind": "integration",
  "name": "Hook power (test fixture)",
  "permissions": [],
  "provides": "hooks",
  "settings": [],
  "ui": {
    "overrides": {
      "hide_nav": [
        "/hooks-fixture-hidden"
      ],
      "pages": {
        "client.hooks-fixture": "override"
      }
    },
    "pages": [
      {
        "area": "client",
        "body": {
          "text": "overridden by fixture",
          "type": "text"
        },
        "id": "override",
        "nav": false,
        "title": "plugin.integration-hooks.override_title"
      }
    ]
  },
  "version": "0.1.0",
  "wasm": "addon.wasm"
}
```

