# Django CFG API - Typescript Client

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

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

## Stats

| | |
|---|---|
| Version | 3.0.3 |
| Operations | 9 |
| Schemas | 15 |

## Resources

- **Backup Codes** (2 ops)
- **TOTP Management** (2 ops)
- **TOTP Setup** (2 ops)
- **TOTP Verification** (2 ops)
- **totp** (1 ops)

## Operations

**Backup Codes:**
- `POST` /cfg/totp/backup-codes/regenerate/ → `cfg_totp_backup_codes_regenerate_create`
- `GET` /cfg/totp/backup-codes/ → `cfg_totp_backup_codes_retrieve`

**TOTP Management:**
- `GET` /cfg/totp/devices/ → `cfg_totp_devices_list`
- `POST` /cfg/totp/disable/ → `cfg_totp_disable_create`

**TOTP Setup:**
- `POST` /cfg/totp/setup/confirm/ → `cfg_totp_setup_confirm_create`
- `POST` /cfg/totp/setup/ → `cfg_totp_setup_create`

**TOTP Verification:**
- `POST` /cfg/totp/verify/backup/ → `cfg_totp_verify_backup_create`
- `POST` /cfg/totp/verify/ → `cfg_totp_verify_create`

**totp:**
- `DELETE` /cfg/totp/devices/{id}/ → `cfg_totp_devices_destroy`

## Usage

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

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

await client.backup codes.retrieve({ id: 1 });
await client.backup codes.create({ ... });
await client.totp management.list();
await client.totp management.create({ ... });
```

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

## 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_totp", 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

