@tty-pt/axil-hyle
Schema-driven REST CRUD connector, partition route registrar, and isomorphic HTTP dataset client bridging@tty-pt/axil,@tty-pt/hyle, and@tty-pt/hyle-source. Canonical C header:<ttypt/axil-hyle.h>.
📖 Full C & Systems Documentation: See the main axil-hyle GitHub README for the complete C route wiring, REST endpoint grammar, and libhyle-source driver integration.
1. Overview & Domain Concepts
axil-hyle (libaxil-hyle.so / @tty-pt/axil-hyle) turns registered Hyle dataset schemas into paginated, searchable REST APIs with automatic validation and ordered child-collection management:
- Automatic Dataset REST Endpoints:
- Mounts
GET /api/dataset/:id(search, filter, sort, pagination),GET /api/dataset/:id/:item_id,POST /api/dataset/:id,PUT /api/dataset/:id/:item_id,DELETE /api/dataset/:id/:item_id, andGET /api/schema/:id.
- Accent-Sensitive Search & Structured Filtering:
- Supports
?q=<search>(accent-preserving lexical search vialiblemma, wherepão ≠ pao),?filter_<field>=<val>,?sort=<field>&order=asc|desc, and?limit=<n>&page=<n>.
- Ordered Partition & Child Collection Routes:
- Manages ordered child sequences (such as setlists in a gig or repertoire items in a group) via
listOrdered,appendOrdered,updateOrdered, andremoveOrdered.
- Isomorphic TypeScript Client (
AxilHyleClient):
- Zero-dependency client for browsers, Node.js, and Next.js Server Components with customizable
fetchand header injection.
2. Installation
npm config set @tty-pt:registry https://tty.pt/npm/
npm install @tty-pt/axil-hyle
Native OS & Mobile Packages (tty.pt): Prebuilt native C packages (axil-hyle) for Linux (apt, apk, pacman, dnf), macOS (brew), Windows (winget, MSYS2), and OpenBSD (pkg_add), plus static mobile sysroots for Android (https://tty.pt/android/) and iOS (https://tty.pt/ios/ — libaxil-hyle.xcframework) are available via the tty.pt package repositories.
3. Quickstart
Launch axil with axil-hyle Loaded
npx axil -d -p 8080 -m auth:hyle
Query & Mutate Datasets with createAxilHyleClient
import {
createAxilHyleClient,
buildDatasetUrl,
getModulePath
} from "@tty-pt/axil-hyle";
const client = createAxilHyleClient({ baseUrl: "http://127.0.0.1:8080" });
// 1. Paginated full-text search & filtering
const songs = await client.list("song", {
q: "fado",
sort: "title",
order: "asc",
limit: 20,
page: 1
});
// 2. Fetch, create, update, and delete a record
const song = await client.get("song", "song_1");
await client.create("song", { id: "song_2", title: "Canção do Mar" });
await client.update("song", "song_2", { title: "Canção do Mar (Live)" });
await client.delete("song", "song_2");
// 3. Manage ordered child collections (e.g. gig setlist items)
await client.appendOrdered("gig", "gig_2026", { song: "song_1", key: "Am" });
const setlist = await client.listOrdered("gig", "gig_2026");
// 4. Construct canonical dataset URLs directly
const url = buildDatasetUrl("song", { query: { q: "pão", limit: 10 } });
console.log("Dataset URL:", url, "Module path:", getModulePath());
4. JavaScript / TypeScript API Reference
createAxilHyleClient(options?: AxilHyleClientOptions): AxilHyleClient
Creates an isomorphic HTTP client for axil-hyle dataset endpoints:
.list(datasetId: string, query?: Record<string, any>): Promise<any>.get(datasetId: string, key: string): Promise<any>.create(datasetId: string, payload: Record<string, any> | string): Promise<any>.update(datasetId: string, key: string, payload: Record<string, any> | string): Promise<any>.delete(datasetId: string, key: string): Promise<any>.listOrdered(datasetId: string, key: string): Promise<any>.appendOrdered(datasetId: string, key: string, payload: Record<string, any> | string): Promise<any>.updateOrdered(datasetId: string, key: string, index: number, payload: Record<string, any> | string): Promise<any>.removeOrdered(datasetId: string, key: string, index: number): Promise<any>
URL & Native Route Registration
buildDatasetUrl(datasetId: string, options?: DatasetUrlOptions): string: Builds canonical/api/dataset/:idURLs with key, ordered index, and query parameters.installRoutes(): boolean: Mounts the generic Hyle REST CRUD handlers into an active nativeaxilhost process.registerPartitionRoutes(spec: PartitionRoutesSpec): boolean: Registers partition/ordered child route handlers in a nativeaxilhost process.getModulePath(): string | null: Resolves the prebuiltlibaxil-hyleshared library path foraxil -m.
5. C Development Headers & Native Integration
CFLAGS += -I./node_modules/@tty-pt/axil-hyle/include
LDLIBS += -laxil-hyle
License
BSD-2-Clause — Copyright (c) 2026, Paulo Quirino <quirinpa@gmail.com>. See LICENSE.