Changelog - 2026-09-17
@venizia/ignis-connectors/http
FeatureIn one line. Read another IGNIS REST server through the repository contract, with no drizzle and no zod in the bundle (12.8 KB gzipped, against 144.2 KB for the connectors root).
ts
import { HttpDataSource, HttpRepository } from '@venizia/ignis-connectors/http';
const dataSource = new HttpDataSource({
baseUrl: 'https://tickets.internal',
authTokenResolver: () => ({ value: readServiceToken() }),
onUnauthorized: async () => {
await refreshServiceToken();
return true; // retry once; false lets the 401 stand
},
});
const tickets = new HttpRepository<ITicket>({ dataSource, resource: 'tickets' });
await tickets.find({ filter: { where: { status: 'open' }, limit: 20 } });What changed
- IGNIS to IGNIS only. It targets the IGNIS REST contract and promises nothing about an arbitrary REST API.
- No header means no total. A list with no
Content-Rangehas no total, andcount()throws rather than report the page size. PasscountPathif the API publishes a count route. An empty page or a page past the end still has a total (records */0,records */137), andcount()reads it. - Auth is configuration.
authTokenResolveris a seam for a server secret or browser storage. An explicitauthTokenis consulted first.onUnauthorizedis a hook that runs on a 401:trueretries once,falselets the 401 stand. - Both list shapes.
x-request-countis the connector's own header and always goes outfalse; aheaderssetting that carries it throws at construction. A list answered as a count envelope is accepted too.read({ shape: 'one' })is never unwrapped. - Caller headers are read as unique lowercase pairs, last spelling winning.
Who is affected
- Nobody. A new sub-path; nothing existing changed.
Details
- A long
inqdoes not fit in a URL. The filter travels in the GET query string. Past about 16 KB (about 400 UUIDs) the server answers 431. Split the ids. - An unknown total is not a total.
records 0-24/*makescount()and a rangedfindthrow with a message naming the header. PlainfindandexistsWithneed no total and keep working.