Changelog - 2026-10-02
@venizia/ignis-connectors/http writes
FeatureIn one line. HttpRepository is no longer read-only: it writes through the CRUD routes another IGNIS server generates, and HttpDataSource can send a body on any method.
ts
const products = new HttpRepository<TProduct>({ dataSource, resource: 'products' });
const { data: product } = await products.create({ data: { name: 'Lamp' } });
await products.updateById({ id: product.id, data: { name: 'Desk lamp' } });
await products.updateBy({ where: { status: 'draft' }, data: { status: 'published' } });
await products.deleteAll({ where: { id: { inq: staleIds } } });
// A route the verbs do not cover:
await dataSource.write({ paths: ['products', product.id], method: 'PUT', body: replacement });What is new
| Method | Request |
|---|---|
create({ data }) | POST /<resource> |
updateById({ id, data }) | PATCH /<resource>/:id |
updateAll / updateBy({ where, data }) | PATCH /<resource>, where in the body beside the data |
deleteById({ id }) | DELETE /<resource>/:id |
deleteAll / deleteBy({ where }) | DELETE /<resource>, where in the body |
HttpDataSource.request()takesbodyand per-requestheaders, on any method. A plain object or array goes out as JSON withcontent-type: application/json; a string,FormData,Blob,URLSearchParams,ArrayBufferor typed array goes as it is. The 401 retry resends the same body.HttpDataSource.write()answers{ data, count }- the rows and the server'sx-response-count.- Server errors come back as the server said them. A failed read or write throws an
ApplicationErrorwith the server's status, itsmessageappended to the connector's, and itsnormalized.codeas the message code. HttpRepository<E, P = Partial<E>>: the second type parameter is what a write sends; the server fills ids and defaults.
Rules worth knowing
- The id in
/:idis URL-encoded, for reads and writes alike. - A bulk
wheretravels in the body, so a longinqdoes not hit the URL limit. An empty bulkwhereis refused before any request - the IGNIS route would refuse it - andforcecannot cross HTTP. shouldReturn: falseanswers{ count, data: null }.- There is no
createAll: the IGNIS REST contract has no bulk-create route. - A per-request
x-request-countis refused, as the setting already was: the connector owns it.
Who is affected
- Code that wrote with bare
fetchbeside the connector. Move to the repository verbs orwrite(); the auth token, the 401 retry and the error mapping come with them. - Code that matched a read error message exactly. A failed read now appends the server's message after the URL.
- Everyone else. Nothing changes; the read verbs are untouched.
Files: