# Django CFG API - Typescript Client

Auto-generated. **Do not edit manually.**

```bash
python manage.py generate_client --groups cfg_centrifugo --typescript
```

## Stats

| | |
|---|---|
| Version | 3.0.3 |
| Operations | 15 |
| Schemas | 35 |

## Resources

- **Centrifugo Admin API** (6 ops)
- **Centrifugo Auth** (1 ops)
- **Centrifugo Monitoring** (5 ops)
- **Centrifugo Testing** (3 ops)

## Operations

**Centrifugo Admin API:**
- `POST` /cfg/centrifugo/server/auth/token/ → `cfg_centrifugo_server_auth_token_create`
- `POST` /cfg/centrifugo/server/channels/ → `cfg_centrifugo_server_channels_create`
- `POST` /cfg/centrifugo/server/history/ → `cfg_centrifugo_server_history_create`
- `POST` /cfg/centrifugo/server/info/ → `cfg_centrifugo_server_info_create`
- `POST` /cfg/centrifugo/server/presence/ → `cfg_centrifugo_server_presence_create`
- `POST` /cfg/centrifugo/server/presence-stats/ → `cfg_centrifugo_server_presence_stats_create`

**Centrifugo Auth:**
- `GET` /cfg/centrifugo/auth/token/ → `cfg_centrifugo_auth_token_retrieve`

**Centrifugo Monitoring:**
- `GET` /cfg/centrifugo/monitor/channels/ → `cfg_centrifugo_monitor_channels_retrieve`
- `GET` /cfg/centrifugo/monitor/health/ → `cfg_centrifugo_monitor_health_retrieve`
- `GET` /cfg/centrifugo/monitor/overview/ → `cfg_centrifugo_monitor_overview_retrieve`
- `GET` /cfg/centrifugo/monitor/publishes/ → `cfg_centrifugo_monitor_publishes_list`
- `GET` /cfg/centrifugo/monitor/timeline/ → `cfg_centrifugo_monitor_timeline_retrieve`

**Centrifugo Testing:**
- `POST` /cfg/centrifugo/testing/publish-test/ → `cfg_centrifugo_testing_publish_test_create`
- `POST` /cfg/centrifugo/testing/publish-with-logging/ → `cfg_centrifugo_testing_publish_with_logging_create`
- `POST` /cfg/centrifugo/testing/send-ack/ → `cfg_centrifugo_testing_send_ack_create`

## Usage

```typescript
import { APIClient } from './';

const client = new APIClient({ baseUrl, token });

await client.centrifugo auth.retrieve({ id: 1 });
await client.centrifugo monitoring.list();
await client.centrifugo monitoring.retrieve({ id: 1 });
```

**SWR Hooks:**
```typescript
import { useCentrifugo authList } from './hooks';
const { data, isLoading } = useCentrifugo authList();
```

## How It Works

```
DRF ViewSets → drf-spectacular → OpenAPI → IR Parser → Generator → This Client
```

**Configuration** (`api/config.py`):
```python
openapi_client = OpenAPIClientConfig(
    enabled=True,
    groups=[OpenAPIGroupConfig(name="cfg_centrifugo", apps=["..."])],
    generate_zod_schemas=True,  # → schemas.ts
    generate_fetchers=True,     # → fetchers.ts
    generate_swr_hooks=True,    # → hooks.ts
)
```

@see https://djangocfg.com/docs/features/api-generation

