Save notes and documentation updates
This commit is contained in:
@@ -149,7 +149,60 @@ export async function delete_ae_obj_v3({ api_cfg, obj_type, obj_id }) {
|
||||
|
||||
---
|
||||
|
||||
## 4. Authentication in V3
|
||||
## 4. Specialized & Context Endpoints
|
||||
|
||||
### A. Initial Context Resolution (FQDN)
|
||||
**Path**: `GET /crud/site/domain/{fqdn}?use_alt_table=true&use_alt_base=true`
|
||||
|
||||
This is a **critical public endpoint** used by the Svelte frontend during initial load.
|
||||
- **Requirement**: Does NOT require `X-Account-ID` header (it resolves it).
|
||||
- **Purpose**: Returns the `account_id` and site configuration associated with the current URL.
|
||||
- **Backend**: Currently routed via legacy V1/V2 `api_crud.py` for maximum compatibility.
|
||||
|
||||
```ts
|
||||
// Example: resolve context from current location
|
||||
const fqdn = window.location.host;
|
||||
const endpoint = `/crud/site/domain/${fqdn}`;
|
||||
const context = await get_object({
|
||||
api_cfg,
|
||||
endpoint,
|
||||
params: { use_alt_table: true, use_alt_base: true }
|
||||
});
|
||||
// result includes account_id and account_id_random
|
||||
```
|
||||
|
||||
### B. Schema Discovery
|
||||
**Path**: `GET /v3/crud/{obj_type}/schema`
|
||||
|
||||
Used for developer tools or dynamic UI builders to understand the structure of an AE object. Returns:
|
||||
- Database column names and SQL types.
|
||||
- Pydantic model field names, aliases, and TypeScript-compatible types.
|
||||
|
||||
```ts
|
||||
// GET /v3/crud/account/schema
|
||||
export async function get_obj_schema_v3({ api_cfg, obj_type }) {
|
||||
const endpoint = `/v3/crud/${obj_type}/schema`;
|
||||
return await get_object({ api_cfg, endpoint });
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 5. Advanced Search Logic
|
||||
|
||||
### A. Standardized Global Search (`q`)
|
||||
Use the `q` property in your search body for a keyword search.
|
||||
- **Wildcard Support**: Setting `q: "%"` will bypass all text filtering and return all records (respecting only logical filters like `enable`).
|
||||
- **Fallback**: If the table lacks a `default_qry_str` column, the API automatically performs a `LIKE` search across all searchable fields.
|
||||
|
||||
```json
|
||||
{
|
||||
"q": "%",
|
||||
"and": [{ "field": "enable", "op": "eq", "value": true }]
|
||||
}
|
||||
```
|
||||
|
||||
## 6. Authentication in V3
|
||||
|
||||
V3 supports multiple authentication methods. The backend resolves these automatically.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user