Changeset 0.37.14 (#226)
Co-authored-by: gobha <jasafpro@gmail.com> Co-committed-by: gobha <jasafpro@gmail.com>
This commit is contained in:
@@ -248,3 +248,62 @@ This endpoint is the SDK's bootstrap source for `sw.can(permission)`.
|
||||
Called once at login and on each token refresh.
|
||||
|
||||
---
|
||||
|
||||
### Bootstrap (v0.37.15)
|
||||
|
||||
```
|
||||
GET /profile/bootstrap
|
||||
```
|
||||
|
||||
**Auth:** Authenticated user
|
||||
|
||||
Single-call boot payload for the SDK. Collapses what previously required
|
||||
3–4 sequential requests (profile, permissions, teams/mine, settings) into
|
||||
one call. The SDK calls this at startup and on token refresh.
|
||||
|
||||
**Response:**
|
||||
|
||||
```json
|
||||
{
|
||||
"user": {
|
||||
"id": "uuid",
|
||||
"username": "jdoe",
|
||||
"display_name": "Jane Doe",
|
||||
"email": "jdoe@example.com",
|
||||
"role": "user",
|
||||
"avatar": "data:image/png;base64,..."
|
||||
},
|
||||
"permissions": ["channel.create", "kb.read", "model.use"],
|
||||
"groups": ["group-id-1", "00000000-0000-0000-0000-000000000001"],
|
||||
"teams": [
|
||||
{ "id": "uuid", "name": "Engineering", "my_role": "member" }
|
||||
],
|
||||
"policies": {
|
||||
"allow_user_byok": false,
|
||||
"allow_user_personas": false,
|
||||
"allow_raw_model_access": true,
|
||||
"kb_direct_access": true
|
||||
},
|
||||
"settings": {
|
||||
"theme": "dark",
|
||||
"editor_keybindings": "vim"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| Field | Type | Description |
|
||||
|-------|------|-------------|
|
||||
| `user` | object | Curated profile (same fields as `GET /profile` minus timestamps) |
|
||||
| `permissions` | string[] | Resolved permission set (sorted). Admins get all. |
|
||||
| `groups` | string[] | Contributing group IDs (always includes Everyone) |
|
||||
| `teams` | object[] | Active team memberships with `my_role` |
|
||||
| `policies` | object | Boolean policy flags for UI feature gating |
|
||||
| `settings` | object | User preferences (`{}` if never saved) |
|
||||
|
||||
`user.avatar` is omitted when unset (not `null`).
|
||||
|
||||
This is a **superset** of `GET /profile/permissions` — it includes
|
||||
everything that endpoint returns plus `user` and `settings`. Clients
|
||||
that only need permissions can continue using the narrower endpoint.
|
||||
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user