# Django CFG API - Typescript Client

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

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

## Stats

| | |
|---|---|
| Version | 3.0.3 |
| Operations | 14 |
| Schemas | 20 |

## Resources

- **Auth** (1 ops)
- **OAuth** (5 ops)
- **User Profile** (6 ops)
- **accounts** (2 ops)

## Operations

**Auth:**
- `POST` /cfg/accounts/token/refresh/ → `cfg_accounts_token_refresh_create`

**OAuth:**
- `GET` /cfg/accounts/oauth/connections/ → `cfg_accounts_oauth_connections_list`
- `POST` /cfg/accounts/oauth/disconnect/ → `cfg_accounts_oauth_disconnect_create`
- `POST` /cfg/accounts/oauth/github/authorize/ → `cfg_accounts_oauth_github_authorize_create`
- `POST` /cfg/accounts/oauth/github/callback/ → `cfg_accounts_oauth_github_callback_create`
- `GET` /cfg/accounts/oauth/providers/ → `cfg_accounts_oauth_providers_retrieve`

**User Profile:**
- `POST` /cfg/accounts/profile/avatar/ → `cfg_accounts_profile_avatar_create`
- `PATCH` /cfg/accounts/profile/partial/ → `cfg_accounts_profile_partial_partial_update`
- `PUT` /cfg/accounts/profile/partial/ → `cfg_accounts_profile_partial_update`
- `GET` /cfg/accounts/profile/ → `cfg_accounts_profile_retrieve`
- `PATCH` /cfg/accounts/profile/update/ → `cfg_accounts_profile_update_partial_update`
- `PUT` /cfg/accounts/profile/update/ → `cfg_accounts_profile_update_update`

**accounts:**
- `POST` /cfg/accounts/otp/request/ → `cfg_accounts_otp_request_create`
- `POST` /cfg/accounts/otp/verify/ → `cfg_accounts_otp_verify_create`

## Usage

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

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

await client.oauth.list();
await client.oauth.retrieve({ id: 1 });
await client.oauth.create({ ... });
await client.accounts.create({ ... });
```

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

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

