feat: phase 2 api parity endpoints for extension
This commit is contained in:
43
phase-2-api.md
Normal file
43
phase-2-api.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# Phase 2 API Delivery
|
||||
|
||||
## Implemented endpoints (Laravel app)
|
||||
|
||||
Base path: `app/` project
|
||||
|
||||
- `GET /v1/categories`
|
||||
- `GET /v1/emojis`
|
||||
- `POST /v1/license/verify`
|
||||
- `OPTIONS /v1/{any}` (CORS preflight)
|
||||
|
||||
## Compatibility behavior
|
||||
|
||||
- `/v1/*` routes are exposed without `/api` prefix (extension-compatible).
|
||||
- `GET /v1/emojis` accepts both `q` and `query`.
|
||||
- Responses include `X-Dewemoji-Tier` header.
|
||||
|
||||
## Current license mode
|
||||
|
||||
Environment-driven stub:
|
||||
|
||||
- `DEWEMOJI_LICENSE_ACCEPT_ALL=true` => any key is accepted as Pro.
|
||||
- `DEWEMOJI_PRO_KEYS=key1,key2` => explicit key whitelist mode.
|
||||
|
||||
## Data source
|
||||
|
||||
Configured via:
|
||||
|
||||
- `DEWEMOJI_DATA_PATH` (defaults to `../../dewemoji-api/data/emojis.json` from `app/`).
|
||||
|
||||
## Test coverage
|
||||
|
||||
Added feature tests:
|
||||
|
||||
- `app/tests/Feature/ApiV1EndpointsTest.php`
|
||||
- fixture: `app/tests/Fixtures/emojis.fixture.json`
|
||||
|
||||
Run:
|
||||
|
||||
```bash
|
||||
cd app
|
||||
php artisan test --filter=ApiV1EndpointsTest
|
||||
```
|
||||
Reference in New Issue
Block a user