@venizia/ignis-atlas 0.1.1-2 → 0.1.1-4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/corpus/changelogs/2026-10-06-dev-configs-react-preset.md +65 -0
- package/dist/corpus/changelogs/2026-10-06-http-connector-contract.md +66 -0
- package/dist/corpus/changelogs/index.md +2 -1
- package/dist/corpus/releases.json +70 -12
- package/dist/corpus/symbols.json +80 -30
- package/dist/corpus/wiki/best-practices/architectural-patterns.md +0 -2
- package/dist/corpus/wiki/best-practices/code-style-standards/tooling.md +16 -0
- package/dist/corpus/wiki/guides/core-concepts/rest-controllers.md +0 -2
- package/dist/corpus/wiki/guides/tutorials/building-a-crud-api.md +0 -2
- package/dist/corpus/wiki/references/base/controllers.md +0 -3
- package/dist/corpus/wiki/references/base/filter-system/application-usage.md +0 -4
- package/dist/corpus/wiki/references/base/filter-system/quick-reference.md +1 -1
- package/dist/corpus/wiki/references/base/repositories/index.md +40 -2
- package/dist/corpus/wiki/references/quick-reference.md +40 -16
- package/package.json +2 -2
- package/dist/corpus/changelogs/2026-10-02-body-filter-read-routes.md +0 -48
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: dev-configs Gains a React Preset
|
|
3
|
+
description: "ReactEslintConfigs gives a React frontend the same lint base as its backend, plus React, hooks and accessibility rules. The base drops a duplicate rule and raises ban-ts-comment and no-namespace to error."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Changelog - 2026-10-06
|
|
7
|
+
|
|
8
|
+
## A React frontend shares one lint source with its backend
|
|
9
|
+
|
|
10
|
+
<Badge type="tip" text="Feature" /> <Badge type="warning" text="Behavior Change" />
|
|
11
|
+
|
|
12
|
+
**In one line.** `@venizia/dev-configs` exports `ReactEslintConfigs`: the base preset plus what a React frontend needs.
|
|
13
|
+
|
|
14
|
+
```js
|
|
15
|
+
// eslint.config.mjs
|
|
16
|
+
import { ReactEslintConfigs } from '@venizia/dev-configs';
|
|
17
|
+
import react from 'eslint-plugin-react';
|
|
18
|
+
import reactHooks from 'eslint-plugin-react-hooks';
|
|
19
|
+
import jsxA11y from 'eslint-plugin-jsx-a11y';
|
|
20
|
+
|
|
21
|
+
export default ReactEslintConfigs.create({ plugins: { react, reactHooks, jsxA11y } });
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## What changed
|
|
25
|
+
|
|
26
|
+
Until now, dev-configs had no React rule. A frontend kept a second base preset or re-declared the same rules in every package, and the copies drifted.
|
|
27
|
+
|
|
28
|
+
`ReactEslintConfigs.create()` takes the plugins as options, so a backend that never calls it installs nothing new. `reactVersion` defaults to `'detect'`; under ESLint 10, pass it (`'19.2'`), since eslint-plugin-react 7 cannot detect it there. On top of `eslintConfigs` it adds:
|
|
29
|
+
|
|
30
|
+
| Adds | Setting |
|
|
31
|
+
|---|---|
|
|
32
|
+
| React correctness - `jsx-key`, `no-children-prop`, `no-deprecated` and 11 more | `error`, `.jsx`/`.tsx` |
|
|
33
|
+
| `jsx-a11y` basics - `alt-text`, `aria-props`, `aria-role` and 6 more | `error`, `.jsx`/`.tsx` |
|
|
34
|
+
| `react-hooks/rules-of-hooks` | `error`, `.js`/`.jsx`/`.ts`/`.tsx` - custom hooks live in `.ts` too |
|
|
35
|
+
| `react-hooks/exhaustive-deps` | `warn`, `.js`/`.jsx`/`.ts`/`.tsx` |
|
|
36
|
+
| `@typescript-eslint/consistent-type-imports` | `error`, `prefer: 'type-imports'` |
|
|
37
|
+
| `@typescript-eslint/no-explicit-any` | `warn` - the base has it `off` |
|
|
38
|
+
|
|
39
|
+
It relaxes what a UI does on purpose:
|
|
40
|
+
|
|
41
|
+
| Rule | Setting | Why |
|
|
42
|
+
|---|---|---|
|
|
43
|
+
| `naming-convention` | the base rule plus PascalCase functions, `.jsx`/`.tsx` | `function App()` is a component |
|
|
44
|
+
| `no-floating-promises`, `no-void` | `off` | Event handlers and effects fire promises they do not await |
|
|
45
|
+
| `no-invalid-this`, `no-use-before-define` | `off` | Function components; a component may be used above its declaration |
|
|
46
|
+
| `no-shadow` | `warn` | |
|
|
47
|
+
| `no-unused-vars` | `warn`, `_`-prefixed names ignored | |
|
|
48
|
+
|
|
49
|
+
Rules the automatic JSX runtime or `tsc` already enforce - `react-in-jsx-scope`, `prop-types`, `jsx-no-undef`, `jsx-no-duplicate-props`, `no-unknown-property` - are left out.
|
|
50
|
+
|
|
51
|
+
**The base, for every consumer.**
|
|
52
|
+
|
|
53
|
+
| Rule | Before | Now |
|
|
54
|
+
|---|---|---|
|
|
55
|
+
| `@typescript-eslint/ban-ts-comment` | `off` | `error`. `@ts-expect-error` with a description is still allowed |
|
|
56
|
+
| `@typescript-eslint/no-namespace` | `off` | `error` |
|
|
57
|
+
| `curly` | declared twice | declared once, by the upstream preset; same value |
|
|
58
|
+
|
|
59
|
+
## Who is affected
|
|
60
|
+
|
|
61
|
+
- **A React frontend.** Replace a second base preset, or per-package React rules, with `ReactEslintConfigs.create()`. Keep only your house rules on top.
|
|
62
|
+
- **Code with `@ts-ignore`, `@ts-nocheck`, or a bare `@ts-expect-error`.** It now fails lint. Use `@ts-expect-error` with a reason.
|
|
63
|
+
- **Code with a `namespace`.** It now fails lint. Use modules.
|
|
64
|
+
|
|
65
|
+
**Files:** [`packages/dev-configs/src/react.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/dev-configs/src/react.ts), [`packages/dev-configs/src/eslint.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/dev-configs/src/eslint.ts)
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: The HTTP Connector Follows the Session and Keeps the Server's Errors
|
|
3
|
+
description: "connectors/http gains per-request hooks, per-call headers and abort, and an error that is the one the server threw - including under error.rootKey. Ids and baseUrls that name the wrong route are refused."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Changelog - 2026-10-06
|
|
7
|
+
|
|
8
|
+
## The HTTP connector follows the session and keeps the server's errors
|
|
9
|
+
|
|
10
|
+
<Badge type="tip" text="Feature" /> <Badge type="danger" text="Bug Fix" /> <Badge type="warning" text="Behavior Change" />
|
|
11
|
+
|
|
12
|
+
**In one line.** `@venizia/ignis-connectors/http` now works the way a browser app needs: its headers and token follow the session, one call can add headers or abort, and a failure is the error the server threw.
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
new HttpDataSource({
|
|
16
|
+
baseUrl: '/api',
|
|
17
|
+
errorRootKey: 'error',
|
|
18
|
+
headersResolver: () => ({ 'x-locale': session.locale }),
|
|
19
|
+
authTokenResolver: ({ paths }) => (paths[0] === 'auth' ? undefined : session.token),
|
|
20
|
+
onUnauthorized: ({ paths }) => (paths[0] === 'auth' ? false : session.refresh()),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
await products.find({ filter, options: { headers: { 'x-trace': id }, signal } });
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## What changed
|
|
27
|
+
|
|
28
|
+
**The session.** `settings.headers` is read once, when the datasource is built. `headersResolver` runs on every send, the 401 retry included. `authTokenResolver` and `onUnauthorized` now receive the request they serve (`{ paths, method, url, signal }`), so a public route can send no token and skip the refresh. A throw from a resolver fails that request.
|
|
29
|
+
|
|
30
|
+
**One call.** Every repository verb, `read()`, `write()` and `request()` take `headers` and `signal` in their options. A call aborted while `onUnauthorized` runs is not retried.
|
|
31
|
+
|
|
32
|
+
**Errors.** A server with `error.rootKey` wraps its error envelope, and the connector read every such failure as `core.system_error`. Set `errorRootKey` to the same key. The thrown error now carries:
|
|
33
|
+
|
|
34
|
+
| Field | Value |
|
|
35
|
+
|---|---|
|
|
36
|
+
| `statusCode` | The response status |
|
|
37
|
+
| `normalized.code`, `normalized.args`, `normalized.text` | The server's own. A server that sent no text (a proxy's HTML 502) reads as `HTTP 502` |
|
|
38
|
+
| `extra` | The server's `extra`, with `requestId` added. A relaying server's own upstream id is kept as `upstreamRequestId` |
|
|
39
|
+
| `cause` | The server's `details.cause` - a 422's per-field issues, `{ path, message, code }` |
|
|
40
|
+
| `message` | The server's text, prefixed with the verb, status and path, for logs. The host and query are left out: a server that relays the error would send them to its own clients |
|
|
41
|
+
|
|
42
|
+
**Requests that named the wrong route.**
|
|
43
|
+
|
|
44
|
+
| Before | Now |
|
|
45
|
+
|---|---|
|
|
46
|
+
| `deleteById({ id: '.' })` sent `DELETE /users/` - the bulk route, behind a router or proxy that ignores the trailing slash | An empty, `.` or `..` id throws 400 before any request |
|
|
47
|
+
| `baseUrl: 'api'` followed the current page route; `'localhost:3000'` was taken as absolute | A `baseUrl` is absolute or starts with `/`; anything else throws at construction |
|
|
48
|
+
| A `FormData` body went out as `application/json`, with no boundary, when a content-type was configured | A `FormData` body always carries the multipart content-type `fetch` writes |
|
|
49
|
+
| An empty list body, a non-JSON answer or a bigint in a query threw a bare `SyntaxError` or `TypeError` | They throw an `ApplicationError` (500, 502, 400) |
|
|
50
|
+
|
|
51
|
+
**Readers.** `HttpResponseReader` is exported - `parseContentRange`, `readErrorEnvelope` and `readError` - for a client that talks to the same server without the connector.
|
|
52
|
+
|
|
53
|
+
A missing `Content-Range` now names the likely cross-origin cause: the server must list it in `Access-Control-Expose-Headers`.
|
|
54
|
+
|
|
55
|
+
## Who is affected
|
|
56
|
+
|
|
57
|
+
- **An app with run-time session headers or public routes.** Move them into `headersResolver` and `authTokenResolver`.
|
|
58
|
+
- **A server with `error.rootKey`.** Set `errorRootKey`, or every error reads as `core.system_error`.
|
|
59
|
+
- **An app with a path-relative `baseUrl`.** Change `api` to `/api`.
|
|
60
|
+
- **Code that read `error.extra`.** It now holds the server's `extra` beside `requestId`.
|
|
61
|
+
- **Code that parsed the URL out of `error.message`.** The message names the path only.
|
|
62
|
+
- **Code that wrote `where` into a `findById` filter literal.** It no longer type-checks: the server always replaced it with the id.
|
|
63
|
+
- **A subclass that overrides `resolveAuthToken()`.** It now receives `{ context }`.
|
|
64
|
+
- **A subclass that overrides `request()` to wrap every call.** `read()` and `write()` no longer go through it; override `sendRequest()`, which every call reaches.
|
|
65
|
+
|
|
66
|
+
**Files:** [`packages/connectors/src/http/datasource.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/connectors/src/http/datasource.ts), [`packages/connectors/src/http/repository.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/connectors/src/http/repository.ts), [`packages/connectors/src/http/common/readers.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/connectors/src/http/common/readers.ts)
|
|
@@ -17,7 +17,8 @@ This section tracks the history of significant changes, refactors, and updates t
|
|
|
17
17
|
|
|
18
18
|
| Date | Title | Type |
|
|
19
19
|
|------|-------|------|
|
|
20
|
-
| 2026-10-
|
|
20
|
+
| 2026-10-06 | [dev-configs Gains a React Preset](./2026-10-06-dev-configs-react-preset) | Feature, Behavior Change |
|
|
21
|
+
| 2026-10-06 | [The HTTP Connector Follows the Session and Keeps the Server's Errors](./2026-10-06-http-connector-contract) | Feature, Bug Fix, Behavior Change |
|
|
21
22
|
| 2026-10-02 | [HTTP Connector Errors Keep the Server Message Args](./2026-10-02-http-connector-error-args) | Bug Fix |
|
|
22
23
|
| 2026-10-02 | [The HTTP Connector Writes](./2026-10-02-http-connector-writes) | Feature |
|
|
23
24
|
| 2026-09-30 | [installBffFetch Matches Whole Path Segments, and Can Be Limited to Named Origins](./2026-09-30-bff-fetch-bridge-matching) | Bug Fix |
|
|
@@ -13,6 +13,18 @@
|
|
|
13
13
|
],
|
|
14
14
|
"releases": {
|
|
15
15
|
"atlas": [
|
|
16
|
+
{
|
|
17
|
+
"version": "0.1.1-3",
|
|
18
|
+
"date": "2026-10-02",
|
|
19
|
+
"sha": "49c083d1",
|
|
20
|
+
"order": 1563
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"version": "0.1.1-2",
|
|
24
|
+
"date": "2026-10-02",
|
|
25
|
+
"sha": "34a103b4",
|
|
26
|
+
"order": 1557
|
|
27
|
+
},
|
|
16
28
|
{
|
|
17
29
|
"version": "0.1.1-1",
|
|
18
30
|
"date": "2026-10-02",
|
|
@@ -761,6 +773,18 @@
|
|
|
761
773
|
}
|
|
762
774
|
],
|
|
763
775
|
"connectors": [
|
|
776
|
+
{
|
|
777
|
+
"version": "0.2.1-4",
|
|
778
|
+
"date": "2026-10-06",
|
|
779
|
+
"sha": "1b52b7d2",
|
|
780
|
+
"order": 1568
|
|
781
|
+
},
|
|
782
|
+
{
|
|
783
|
+
"version": "0.2.1-3",
|
|
784
|
+
"date": "2026-10-02",
|
|
785
|
+
"sha": "1a36e346",
|
|
786
|
+
"order": 1560
|
|
787
|
+
},
|
|
764
788
|
{
|
|
765
789
|
"version": "0.2.1-2",
|
|
766
790
|
"date": "2026-10-02",
|
|
@@ -1917,6 +1941,18 @@
|
|
|
1917
1941
|
}
|
|
1918
1942
|
],
|
|
1919
1943
|
"core-server": [
|
|
1944
|
+
{
|
|
1945
|
+
"version": "0.2.1-4",
|
|
1946
|
+
"date": "2026-10-06",
|
|
1947
|
+
"sha": "69f2f7f0",
|
|
1948
|
+
"order": 1569
|
|
1949
|
+
},
|
|
1950
|
+
{
|
|
1951
|
+
"version": "0.2.1-3",
|
|
1952
|
+
"date": "2026-10-02",
|
|
1953
|
+
"sha": "f200bee0",
|
|
1954
|
+
"order": 1561
|
|
1955
|
+
},
|
|
1920
1956
|
{
|
|
1921
1957
|
"version": "0.2.1-2",
|
|
1922
1958
|
"date": "2026-10-02",
|
|
@@ -2545,6 +2581,12 @@
|
|
|
2545
2581
|
}
|
|
2546
2582
|
],
|
|
2547
2583
|
"dev-configs": [
|
|
2584
|
+
{
|
|
2585
|
+
"version": "0.2.1-0",
|
|
2586
|
+
"date": "2026-10-06",
|
|
2587
|
+
"sha": "d5e516dd",
|
|
2588
|
+
"order": 1567
|
|
2589
|
+
},
|
|
2548
2590
|
{
|
|
2549
2591
|
"version": "0.2.0",
|
|
2550
2592
|
"date": "2026-09-24",
|
|
@@ -4183,6 +4225,12 @@
|
|
|
4183
4225
|
}
|
|
4184
4226
|
],
|
|
4185
4227
|
"kernel": [
|
|
4228
|
+
{
|
|
4229
|
+
"version": "0.2.1-2",
|
|
4230
|
+
"date": "2026-10-02",
|
|
4231
|
+
"sha": "6609b17f",
|
|
4232
|
+
"order": 1559
|
|
4233
|
+
},
|
|
4186
4234
|
{
|
|
4187
4235
|
"version": "0.2.1-1",
|
|
4188
4236
|
"date": "2026-10-02",
|
|
@@ -4492,6 +4540,28 @@
|
|
|
4492
4540
|
]
|
|
4493
4541
|
},
|
|
4494
4542
|
"changelogs": [
|
|
4543
|
+
{
|
|
4544
|
+
"id": "changelog:2026-10-06-http-connector-contract",
|
|
4545
|
+
"file": "2026-10-06-http-connector-contract.md",
|
|
4546
|
+
"date": "2026-10-06",
|
|
4547
|
+
"title": "The HTTP Connector Follows the Session and Keeps the Server's Errors",
|
|
4548
|
+
"packages": [
|
|
4549
|
+
"connectors"
|
|
4550
|
+
],
|
|
4551
|
+
"kind": "Feature",
|
|
4552
|
+
"order": 1564
|
|
4553
|
+
},
|
|
4554
|
+
{
|
|
4555
|
+
"id": "changelog:2026-10-06-dev-configs-react-preset",
|
|
4556
|
+
"file": "2026-10-06-dev-configs-react-preset.md",
|
|
4557
|
+
"date": "2026-10-06",
|
|
4558
|
+
"title": "dev-configs Gains a React Preset",
|
|
4559
|
+
"packages": [
|
|
4560
|
+
"dev-configs"
|
|
4561
|
+
],
|
|
4562
|
+
"kind": "Feature",
|
|
4563
|
+
"order": 1565
|
|
4564
|
+
},
|
|
4495
4565
|
{
|
|
4496
4566
|
"id": "changelog:2026-10-02-http-connector-writes",
|
|
4497
4567
|
"file": "2026-10-02-http-connector-writes.md",
|
|
@@ -4514,18 +4584,6 @@
|
|
|
4514
4584
|
"kind": "Bug Fix",
|
|
4515
4585
|
"order": 1550
|
|
4516
4586
|
},
|
|
4517
|
-
{
|
|
4518
|
-
"id": "changelog:2026-10-02-body-filter-read-routes",
|
|
4519
|
-
"file": "2026-10-02-body-filter-read-routes.md",
|
|
4520
|
-
"date": "2026-10-02",
|
|
4521
|
-
"title": "Reads Whose Filter Rides in the Body",
|
|
4522
|
-
"packages": [
|
|
4523
|
-
"connectors",
|
|
4524
|
-
"kernel"
|
|
4525
|
-
],
|
|
4526
|
-
"kind": "Feature",
|
|
4527
|
-
"order": 1552
|
|
4528
|
-
},
|
|
4529
4587
|
{
|
|
4530
4588
|
"id": "changelog:2026-09-30-bff-fetch-bridge-matching",
|
|
4531
4589
|
"file": "2026-09-30-bff-fetch-bridge-matching.md",
|
package/dist/corpus/symbols.json
CHANGED
|
@@ -8742,7 +8742,7 @@
|
|
|
8742
8742
|
"specifier": "@venizia/ignis",
|
|
8743
8743
|
"kind": "const",
|
|
8744
8744
|
"file": "packages/kernel/src/base/controllers/common/constants.ts",
|
|
8745
|
-
"line":
|
|
8745
|
+
"line": 40,
|
|
8746
8746
|
"signature": "commonResponseHeaders: TResponseHeaders"
|
|
8747
8747
|
},
|
|
8748
8748
|
{
|
|
@@ -8762,7 +8762,7 @@
|
|
|
8762
8762
|
"specifier": "@venizia/ignis",
|
|
8763
8763
|
"kind": "const",
|
|
8764
8764
|
"file": "packages/kernel/src/base/controllers/factory/definition.ts",
|
|
8765
|
-
"line":
|
|
8765
|
+
"line": 613,
|
|
8766
8766
|
"signature": "conditionalCountResponse: typeof RouteConfigResolver.conditionalCountResponse"
|
|
8767
8767
|
},
|
|
8768
8768
|
{
|
|
@@ -8902,7 +8902,7 @@
|
|
|
8902
8902
|
"specifier": "@venizia/ignis",
|
|
8903
8903
|
"kind": "const",
|
|
8904
8904
|
"file": "packages/kernel/src/base/controllers/factory/definition.ts",
|
|
8905
|
-
"line":
|
|
8905
|
+
"line": 619,
|
|
8906
8906
|
"signature": "defineControllerRouteConfigs: typeof RouteConfigResolver.defineControllerRouteConfigs"
|
|
8907
8907
|
},
|
|
8908
8908
|
{
|
|
@@ -9072,7 +9072,7 @@
|
|
|
9072
9072
|
"specifier": "@venizia/ignis",
|
|
9073
9073
|
"kind": "const",
|
|
9074
9074
|
"file": "packages/kernel/src/base/controllers/common/constants.ts",
|
|
9075
|
-
"line":
|
|
9075
|
+
"line": 55,
|
|
9076
9076
|
"signature": "findResponseHeaders: TResponseHeaders"
|
|
9077
9077
|
},
|
|
9078
9078
|
{
|
|
@@ -9742,7 +9742,7 @@
|
|
|
9742
9742
|
"specifier": "@venizia/ignis",
|
|
9743
9743
|
"kind": "const",
|
|
9744
9744
|
"file": "packages/kernel/src/base/controllers/factory/definition.ts",
|
|
9745
|
-
"line":
|
|
9745
|
+
"line": 614,
|
|
9746
9746
|
"signature": "resolveCountConfig: typeof RouteConfigResolver.resolveCountConfig"
|
|
9747
9747
|
},
|
|
9748
9748
|
{
|
|
@@ -9752,7 +9752,7 @@
|
|
|
9752
9752
|
"specifier": "@venizia/ignis",
|
|
9753
9753
|
"kind": "const",
|
|
9754
9754
|
"file": "packages/kernel/src/base/controllers/factory/definition.ts",
|
|
9755
|
-
"line":
|
|
9755
|
+
"line": 618,
|
|
9756
9756
|
"signature": "resolveCreateConfig: typeof RouteConfigResolver.resolveCreateConfig"
|
|
9757
9757
|
},
|
|
9758
9758
|
{
|
|
@@ -9762,7 +9762,7 @@
|
|
|
9762
9762
|
"specifier": "@venizia/ignis",
|
|
9763
9763
|
"kind": "const",
|
|
9764
9764
|
"file": "packages/kernel/src/base/controllers/factory/definition.ts",
|
|
9765
|
-
"line":
|
|
9765
|
+
"line": 616,
|
|
9766
9766
|
"signature": "resolveFindByIdConfig: typeof RouteConfigResolver.resolveFindByIdConfig"
|
|
9767
9767
|
},
|
|
9768
9768
|
{
|
|
@@ -9772,7 +9772,7 @@
|
|
|
9772
9772
|
"specifier": "@venizia/ignis",
|
|
9773
9773
|
"kind": "const",
|
|
9774
9774
|
"file": "packages/kernel/src/base/controllers/factory/definition.ts",
|
|
9775
|
-
"line":
|
|
9775
|
+
"line": 615,
|
|
9776
9776
|
"signature": "resolveFindConfig: typeof RouteConfigResolver.resolveFindConfig"
|
|
9777
9777
|
},
|
|
9778
9778
|
{
|
|
@@ -9782,7 +9782,7 @@
|
|
|
9782
9782
|
"specifier": "@venizia/ignis",
|
|
9783
9783
|
"kind": "const",
|
|
9784
9784
|
"file": "packages/kernel/src/base/controllers/factory/definition.ts",
|
|
9785
|
-
"line":
|
|
9785
|
+
"line": 617,
|
|
9786
9786
|
"signature": "resolveFindOneConfig: typeof RouteConfigResolver.resolveFindOneConfig"
|
|
9787
9787
|
},
|
|
9788
9788
|
{
|
|
@@ -17191,7 +17191,7 @@
|
|
|
17191
17191
|
"specifier": "@venizia/ignis-connectors/http",
|
|
17192
17192
|
"kind": "class",
|
|
17193
17193
|
"file": "packages/connectors/src/http/datasource.ts",
|
|
17194
|
-
"line":
|
|
17194
|
+
"line": 21,
|
|
17195
17195
|
"signature": "class HttpDataSource extends AbstractDataSource<IHttpDataSourceSettings>"
|
|
17196
17196
|
},
|
|
17197
17197
|
{
|
|
@@ -17201,8 +17201,8 @@
|
|
|
17201
17201
|
"specifier": "@venizia/ignis-connectors/http",
|
|
17202
17202
|
"kind": "class",
|
|
17203
17203
|
"file": "packages/connectors/src/http/repository.ts",
|
|
17204
|
-
"line":
|
|
17205
|
-
"signature": "class HttpRepository<E extends object = AnyType, P extends object = Partial<E>> implements IReadableRepository<E,
|
|
17204
|
+
"line": 39,
|
|
17205
|
+
"signature": "class HttpRepository<E extends object = AnyType, P extends object = Partial<E>> implements IReadableRepository<E, THttpRepositoryOptions>, IUpdatableRepository<E, P, THttpRepositoryOptions>, IDeletableRepository<E, THttpRepositoryOptions>"
|
|
17206
17206
|
},
|
|
17207
17207
|
{
|
|
17208
17208
|
"name": "HttpResourceEntity",
|
|
@@ -17211,9 +17211,19 @@
|
|
|
17211
17211
|
"specifier": "@venizia/ignis-connectors/http",
|
|
17212
17212
|
"kind": "class",
|
|
17213
17213
|
"file": "packages/connectors/src/http/repository.ts",
|
|
17214
|
-
"line":
|
|
17214
|
+
"line": 28,
|
|
17215
17215
|
"signature": "class HttpResourceEntity extends AbstractEntity"
|
|
17216
17216
|
},
|
|
17217
|
+
{
|
|
17218
|
+
"name": "HttpResponseReader",
|
|
17219
|
+
"package": "@venizia/ignis-connectors",
|
|
17220
|
+
"subpath": "./http",
|
|
17221
|
+
"specifier": "@venizia/ignis-connectors/http",
|
|
17222
|
+
"kind": "class",
|
|
17223
|
+
"file": "packages/connectors/src/http/common/readers.ts",
|
|
17224
|
+
"line": 8,
|
|
17225
|
+
"signature": "class HttpResponseReader"
|
|
17226
|
+
},
|
|
17217
17227
|
{
|
|
17218
17228
|
"name": "IAuthToken",
|
|
17219
17229
|
"package": "@venizia/ignis-connectors",
|
|
@@ -17224,6 +17234,16 @@
|
|
|
17224
17234
|
"line": 3,
|
|
17225
17235
|
"signature": "interface IAuthToken"
|
|
17226
17236
|
},
|
|
17237
|
+
{
|
|
17238
|
+
"name": "IHttpCallOptions",
|
|
17239
|
+
"package": "@venizia/ignis-connectors",
|
|
17240
|
+
"subpath": "./http",
|
|
17241
|
+
"specifier": "@venizia/ignis-connectors/http",
|
|
17242
|
+
"kind": "interface",
|
|
17243
|
+
"file": "packages/connectors/src/http/common/types.ts",
|
|
17244
|
+
"line": 35,
|
|
17245
|
+
"signature": "interface IHttpCallOptions"
|
|
17246
|
+
},
|
|
17227
17247
|
{
|
|
17228
17248
|
"name": "IHttpDataSourceSettings",
|
|
17229
17249
|
"package": "@venizia/ignis-connectors",
|
|
@@ -17231,7 +17251,7 @@
|
|
|
17231
17251
|
"specifier": "@venizia/ignis-connectors/http",
|
|
17232
17252
|
"kind": "interface",
|
|
17233
17253
|
"file": "packages/connectors/src/http/common/types.ts",
|
|
17234
|
-
"line":
|
|
17254
|
+
"line": 40,
|
|
17235
17255
|
"signature": "interface IHttpDataSourceSettings"
|
|
17236
17256
|
},
|
|
17237
17257
|
{
|
|
@@ -17241,9 +17261,19 @@
|
|
|
17241
17261
|
"specifier": "@venizia/ignis-connectors/http",
|
|
17242
17262
|
"kind": "interface",
|
|
17243
17263
|
"file": "packages/connectors/src/http/common/types.ts",
|
|
17244
|
-
"line":
|
|
17264
|
+
"line": 68,
|
|
17245
17265
|
"signature": "interface IHttpReadResult<R>"
|
|
17246
17266
|
},
|
|
17267
|
+
{
|
|
17268
|
+
"name": "IHttpRequestContext",
|
|
17269
|
+
"package": "@venizia/ignis-connectors",
|
|
17270
|
+
"subpath": "./http",
|
|
17271
|
+
"specifier": "@venizia/ignis-connectors/http",
|
|
17272
|
+
"kind": "interface",
|
|
17273
|
+
"file": "packages/connectors/src/http/common/types.ts",
|
|
17274
|
+
"line": 10,
|
|
17275
|
+
"signature": "interface IHttpRequestContext"
|
|
17276
|
+
},
|
|
17247
17277
|
{
|
|
17248
17278
|
"name": "IHttpWriteResult",
|
|
17249
17279
|
"package": "@venizia/ignis-connectors",
|
|
@@ -17251,7 +17281,7 @@
|
|
|
17251
17281
|
"specifier": "@venizia/ignis-connectors/http",
|
|
17252
17282
|
"kind": "interface",
|
|
17253
17283
|
"file": "packages/connectors/src/http/common/types.ts",
|
|
17254
|
-
"line":
|
|
17284
|
+
"line": 79,
|
|
17255
17285
|
"signature": "interface IHttpWriteResult<R>"
|
|
17256
17286
|
},
|
|
17257
17287
|
{
|
|
@@ -17261,8 +17291,8 @@
|
|
|
17261
17291
|
"specifier": "@venizia/ignis-connectors/http",
|
|
17262
17292
|
"kind": "type",
|
|
17263
17293
|
"file": "packages/connectors/src/http/common/types.ts",
|
|
17264
|
-
"line":
|
|
17265
|
-
"signature": "type TAuthTokenResolver = () => IAuthToken | undefined"
|
|
17294
|
+
"line": 19,
|
|
17295
|
+
"signature": "type TAuthTokenResolver = (context: IHttpRequestContext) => IAuthToken | undefined"
|
|
17266
17296
|
},
|
|
17267
17297
|
{
|
|
17268
17298
|
"name": "THttpBody",
|
|
@@ -17271,7 +17301,7 @@
|
|
|
17271
17301
|
"specifier": "@venizia/ignis-connectors/http",
|
|
17272
17302
|
"kind": "type",
|
|
17273
17303
|
"file": "packages/connectors/src/http/common/types.ts",
|
|
17274
|
-
"line":
|
|
17304
|
+
"line": 32,
|
|
17275
17305
|
"signature": "type THttpBody = string | object"
|
|
17276
17306
|
},
|
|
17277
17307
|
{
|
|
@@ -17281,9 +17311,19 @@
|
|
|
17281
17311
|
"specifier": "@venizia/ignis-connectors/http",
|
|
17282
17312
|
"kind": "type",
|
|
17283
17313
|
"file": "packages/connectors/src/http/common/types.ts",
|
|
17284
|
-
"line":
|
|
17314
|
+
"line": 25,
|
|
17285
17315
|
"signature": "type THttpHeaders = Headers | Array<[string, string]> | Record<string, string>"
|
|
17286
17316
|
},
|
|
17317
|
+
{
|
|
17318
|
+
"name": "THttpHeadersResolver",
|
|
17319
|
+
"package": "@venizia/ignis-connectors",
|
|
17320
|
+
"subpath": "./http",
|
|
17321
|
+
"specifier": "@venizia/ignis-connectors/http",
|
|
17322
|
+
"kind": "type",
|
|
17323
|
+
"file": "packages/connectors/src/http/common/types.ts",
|
|
17324
|
+
"line": 22,
|
|
17325
|
+
"signature": "type THttpHeadersResolver = (context: IHttpRequestContext) => THttpHeaders | undefined"
|
|
17326
|
+
},
|
|
17287
17327
|
{
|
|
17288
17328
|
"name": "THttpQuery",
|
|
17289
17329
|
"package": "@venizia/ignis-connectors",
|
|
@@ -17291,9 +17331,19 @@
|
|
|
17291
17331
|
"specifier": "@venizia/ignis-connectors/http",
|
|
17292
17332
|
"kind": "type",
|
|
17293
17333
|
"file": "packages/connectors/src/http/common/types.ts",
|
|
17294
|
-
"line":
|
|
17334
|
+
"line": 84,
|
|
17295
17335
|
"signature": "type THttpQuery<E extends object> = { filter?: TFilter<E>; }"
|
|
17296
17336
|
},
|
|
17337
|
+
{
|
|
17338
|
+
"name": "THttpRepositoryOptions",
|
|
17339
|
+
"package": "@venizia/ignis-connectors",
|
|
17340
|
+
"subpath": "./http",
|
|
17341
|
+
"specifier": "@venizia/ignis-connectors/http",
|
|
17342
|
+
"kind": "type",
|
|
17343
|
+
"file": "packages/connectors/src/http/repository.ts",
|
|
17344
|
+
"line": 22,
|
|
17345
|
+
"signature": "type THttpRepositoryOptions = NonNullable<Parameters<IReadableRepository['existsWith']>[0]['options']> & IHttpCallOptions"
|
|
17346
|
+
},
|
|
17297
17347
|
{
|
|
17298
17348
|
"name": "IMeilisearchClientLike",
|
|
17299
17349
|
"package": "@venizia/ignis-connectors",
|
|
@@ -33533,7 +33583,7 @@
|
|
|
33533
33583
|
"specifier": "@venizia/ignis-kernel",
|
|
33534
33584
|
"kind": "const",
|
|
33535
33585
|
"file": "packages/kernel/src/base/controllers/common/constants.ts",
|
|
33536
|
-
"line":
|
|
33586
|
+
"line": 40,
|
|
33537
33587
|
"signature": "commonResponseHeaders: TResponseHeaders"
|
|
33538
33588
|
},
|
|
33539
33589
|
{
|
|
@@ -33553,7 +33603,7 @@
|
|
|
33553
33603
|
"specifier": "@venizia/ignis-kernel",
|
|
33554
33604
|
"kind": "const",
|
|
33555
33605
|
"file": "packages/kernel/src/base/controllers/factory/definition.ts",
|
|
33556
|
-
"line":
|
|
33606
|
+
"line": 613,
|
|
33557
33607
|
"signature": "conditionalCountResponse: typeof RouteConfigResolver.conditionalCountResponse"
|
|
33558
33608
|
},
|
|
33559
33609
|
{
|
|
@@ -33613,7 +33663,7 @@
|
|
|
33613
33663
|
"specifier": "@venizia/ignis-kernel",
|
|
33614
33664
|
"kind": "const",
|
|
33615
33665
|
"file": "packages/kernel/src/base/controllers/factory/definition.ts",
|
|
33616
|
-
"line":
|
|
33666
|
+
"line": 619,
|
|
33617
33667
|
"signature": "defineControllerRouteConfigs: typeof RouteConfigResolver.defineControllerRouteConfigs"
|
|
33618
33668
|
},
|
|
33619
33669
|
{
|
|
@@ -33653,7 +33703,7 @@
|
|
|
33653
33703
|
"specifier": "@venizia/ignis-kernel",
|
|
33654
33704
|
"kind": "const",
|
|
33655
33705
|
"file": "packages/kernel/src/base/controllers/common/constants.ts",
|
|
33656
|
-
"line":
|
|
33706
|
+
"line": 55,
|
|
33657
33707
|
"signature": "findResponseHeaders: TResponseHeaders"
|
|
33658
33708
|
},
|
|
33659
33709
|
{
|
|
@@ -33903,7 +33953,7 @@
|
|
|
33903
33953
|
"specifier": "@venizia/ignis-kernel",
|
|
33904
33954
|
"kind": "const",
|
|
33905
33955
|
"file": "packages/kernel/src/base/controllers/factory/definition.ts",
|
|
33906
|
-
"line":
|
|
33956
|
+
"line": 614,
|
|
33907
33957
|
"signature": "resolveCountConfig: typeof RouteConfigResolver.resolveCountConfig"
|
|
33908
33958
|
},
|
|
33909
33959
|
{
|
|
@@ -33913,7 +33963,7 @@
|
|
|
33913
33963
|
"specifier": "@venizia/ignis-kernel",
|
|
33914
33964
|
"kind": "const",
|
|
33915
33965
|
"file": "packages/kernel/src/base/controllers/factory/definition.ts",
|
|
33916
|
-
"line":
|
|
33966
|
+
"line": 618,
|
|
33917
33967
|
"signature": "resolveCreateConfig: typeof RouteConfigResolver.resolveCreateConfig"
|
|
33918
33968
|
},
|
|
33919
33969
|
{
|
|
@@ -33923,7 +33973,7 @@
|
|
|
33923
33973
|
"specifier": "@venizia/ignis-kernel",
|
|
33924
33974
|
"kind": "const",
|
|
33925
33975
|
"file": "packages/kernel/src/base/controllers/factory/definition.ts",
|
|
33926
|
-
"line":
|
|
33976
|
+
"line": 616,
|
|
33927
33977
|
"signature": "resolveFindByIdConfig: typeof RouteConfigResolver.resolveFindByIdConfig"
|
|
33928
33978
|
},
|
|
33929
33979
|
{
|
|
@@ -33933,7 +33983,7 @@
|
|
|
33933
33983
|
"specifier": "@venizia/ignis-kernel",
|
|
33934
33984
|
"kind": "const",
|
|
33935
33985
|
"file": "packages/kernel/src/base/controllers/factory/definition.ts",
|
|
33936
|
-
"line":
|
|
33986
|
+
"line": 615,
|
|
33937
33987
|
"signature": "resolveFindConfig: typeof RouteConfigResolver.resolveFindConfig"
|
|
33938
33988
|
},
|
|
33939
33989
|
{
|
|
@@ -33943,7 +33993,7 @@
|
|
|
33943
33993
|
"specifier": "@venizia/ignis-kernel",
|
|
33944
33994
|
"kind": "const",
|
|
33945
33995
|
"file": "packages/kernel/src/base/controllers/factory/definition.ts",
|
|
33946
|
-
"line":
|
|
33996
|
+
"line": 617,
|
|
33947
33997
|
"signature": "resolveFindOneConfig: typeof RouteConfigResolver.resolveFindOneConfig"
|
|
33948
33998
|
},
|
|
33949
33999
|
{
|
|
@@ -440,9 +440,7 @@ const _Controller = ControllerFactory.defineCrudController({
|
|
|
440
440
|
| Route | Method | Path | Description |
|
|
441
441
|
|-------|--------|------|-------------|
|
|
442
442
|
| `count` | GET | `/count` | Count records matching filter |
|
|
443
|
-
| `count` | POST | `/count` | Count, `where` in the body |
|
|
444
443
|
| `find` | GET | `/` | List records with filter |
|
|
445
|
-
| `find` | POST | `/find` | List, `filter` in the body |
|
|
446
444
|
| `findById` | GET | `/{id}` | Get single record |
|
|
447
445
|
| `findOne` | GET | `/find-one` | Get first matching record |
|
|
448
446
|
| `create` | POST | `/` | Create new record |
|
|
@@ -97,6 +97,22 @@ bun run eslint --fix # Auto-fix issues
|
|
|
97
97
|
bun run lint:fix # Run both ESLint + Prettier
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
+
### A React frontend
|
|
101
|
+
|
|
102
|
+
`ReactEslintConfigs` is the same base plus the React, hooks and accessibility rules a frontend needs. Pass the plugins in - a backend never installs them:
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
// eslint.config.mjs
|
|
106
|
+
import { ReactEslintConfigs } from '@venizia/dev-configs';
|
|
107
|
+
import react from 'eslint-plugin-react';
|
|
108
|
+
import reactHooks from 'eslint-plugin-react-hooks';
|
|
109
|
+
import jsxA11y from 'eslint-plugin-jsx-a11y';
|
|
110
|
+
|
|
111
|
+
export default ReactEslintConfigs.create({ plugins: { react, reactHooks, jsxA11y } });
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
It adds React correctness and `jsx-a11y` basics on `.jsx`/`.tsx`, `rules-of-hooks` (error) and `exhaustive-deps` (warn) on `.js`/`.jsx`/`.ts`/`.tsx`, and `consistent-type-imports`. Under ESLint 10, pass `reactVersion` (`'19.2'`): eslint-plugin-react 7 cannot detect it there. It relaxes what a UI does on purpose: PascalCase function components, promises fired from handlers, `_`-prefixed unused names. The full table is in the [package README](https://github.com/VENIZIA-AI/ignis/blob/main/packages/dev-configs/README.md).
|
|
115
|
+
|
|
100
116
|
## TypeScript Configuration
|
|
101
117
|
|
|
102
118
|
Use the centralized TypeScript configs:
|
|
@@ -247,9 +247,7 @@ The `ControllerFactory.defineCrudController` method automatically sets up the fo
|
|
|
247
247
|
| Route Name | Method | Path | Description |
|
|
248
248
|
| :--- | :--- | :--- | :--- |
|
|
249
249
|
| `count` | `GET` | `/count` | Get the number of records matching a filter. |
|
|
250
|
-
| `count` | `POST` | `/count` | The same count, with the `where` in the body. |
|
|
251
250
|
| `find` | `GET` | `/` | Retrieve all records matching a filter. |
|
|
252
|
-
| `find` | `POST` | `/find` | The same list, with the `filter` in the body. |
|
|
253
251
|
| `findById` | `GET` | `/{id}` | Retrieve a single record by its ID. |
|
|
254
252
|
| `findOne` | `GET` | `/find-one` | Retrieve a single record matching a filter. |
|
|
255
253
|
| `create` | `POST` | `/` | Create a new record. |
|
|
@@ -352,8 +352,6 @@ export * from './todo.controller';
|
|
|
352
352
|
| GET | `/todos/{id}` | Get todo by ID (findById) |
|
|
353
353
|
| GET | `/todos/find-one` | Find one todo by filter (findOne) |
|
|
354
354
|
| GET | `/todos/count` | Count todos (count) |
|
|
355
|
-
| POST | `/todos/find` | List todos, filter in the body (find) |
|
|
356
|
-
| POST | `/todos/count` | Count todos, where in the body (count) |
|
|
357
355
|
| POST | `/todos` | Create todo (create) |
|
|
358
356
|
| PATCH | `/todos/{id}` | Update todo by ID (updateById) |
|
|
359
357
|
| PATCH | `/todos` | Update multiple todos by filter (updateBy) |
|
|
@@ -665,7 +665,6 @@ class RestPaths {
|
|
|
665
665
|
static readonly ROOT = '/';
|
|
666
666
|
static readonly COUNT = '/count';
|
|
667
667
|
static readonly FIND_ONE = '/find-one';
|
|
668
|
-
static readonly FIND = '/find'; // POST only: the filter in the body
|
|
669
668
|
}
|
|
670
669
|
```
|
|
671
670
|
|
|
@@ -692,9 +691,7 @@ Returns a `BaseRestController` subclass with standard CRUD endpoints pre-configu
|
|
|
692
691
|
| Route Name | Method | Path | Description |
|
|
693
692
|
| :--- | :--- | :--- | :--- |
|
|
694
693
|
| `count` | `GET` | `/count` | Count records matching a where condition |
|
|
695
|
-
| `count` | `POST` | `/count` | The same count, the `where` in the body - for one too long for a URL |
|
|
696
694
|
| `find` | `GET` | `/` | Find records with filter, pagination, sorting, and relations |
|
|
697
|
-
| `find` | `POST` | `/find` | The same find, the `filter` in the body - same rows, same `Content-Range` |
|
|
698
695
|
| `findById` | `GET` | `/{id}` | Find a single record by its ID |
|
|
699
696
|
| `findOne` | `GET` | `/find-one` | Find the first record matching a filter |
|
|
700
697
|
| `create` | `POST` | `/` | Create a new record |
|
|
@@ -56,13 +56,9 @@ This generates every filter-bearing endpoint the resource needs:
|
|
|
56
56
|
| GET | `/products/{id}` | `filter` (`where` is ignored - the id is the condition) |
|
|
57
57
|
| GET | `/products/find-one` | `filter` |
|
|
58
58
|
| GET | `/products/count` | `where` |
|
|
59
|
-
| POST | `/products/find` | `filter`, in the JSON body |
|
|
60
|
-
| POST | `/products/count` | `where`, in the JSON body |
|
|
61
59
|
|
|
62
60
|
Set `isStrict.requestSchema: true` to make these query params Zod-required; set `isStrict.path: true` to reject trailing-slash variants of the route. Write endpoints (`POST /`, `PATCH /{id}`, `DELETE /{id}`, ...) come from the same factory call and take no filter.
|
|
63
61
|
|
|
64
|
-
The two `POST` reads exist because a query string has a length limit: a long `inq` overflows it (a proxy commonly caps a request line near 8 KB, about 165 UUIDs). They answer exactly what their `GET` twins answer and ride the same route key, so `routes.find`/`routes.count` - `enabled`, `authenticate`, `authorize`, request schema - govern both, and `getBaseWhere` scopes both. A hand-written route gets the same by adding a POST twin whose body is `FilterQuerySchema` (it accepts an object as well as a JSON string) and whose handler reads `context.req.valid('json')`.
|
|
65
|
-
|
|
66
62
|
## Map a request query string to a parsed filter
|
|
67
63
|
|
|
68
64
|
`FilterSchema` and `WhereSchema` both accept a JSON string or a plain object, so the same schema validates a Hono query param (always a string) and a filter built in code:
|
|
@@ -121,7 +121,7 @@ A dot-notation key targets a JSON/JSONB column instead of a top-level one.
|
|
|
121
121
|
| Array index | `{ 'metadata.tags[0]': 'urgent' }` | Access an array element |
|
|
122
122
|
| Combined | `{ 'metadata.users[0].email': value }` | Nested arrays and objects |
|
|
123
123
|
|
|
124
|
-
**Supported operators:**
|
|
124
|
+
**Supported operators:** every operator a top-level column takes - a JSON path uses the same operator table. The array operators are the exception in practice (see the warning).
|
|
125
125
|
|
|
126
126
|
> [!WARNING]
|
|
127
127
|
> The array operators (`contains`/`containedBy`/`overlaps`) are **not** rejected on a JSON path - they compile, then fail at the database, because a JSON extraction is text and they need a real array column. Use a `varchar[]`/`text[]` column for array algebra.
|
|
@@ -197,10 +197,11 @@ await productRepository.deleteAll({ where: { id: { inq: staleIds } } });
|
|
|
197
197
|
|
|
198
198
|
- A write sends a partial row by default (`HttpRepository<TRow, TWrite = Partial<TRow>>`), since the server fills ids and defaults.
|
|
199
199
|
- The id is URL-encoded. A bulk `where` travels in the body, so a long id list does not hit the URL limit.
|
|
200
|
-
- A **read**
|
|
200
|
+
- A **read** filter travels in the GET query string, so a long `inq` does hit it: about 170 UUIDs fit behind an 8 KB proxy buffer and about 400 behind 16 KB, after which the server or proxy answers 414 or 431, and the error says the URL is too long. The generated routes take no body filter. Split the id list into reads that fit (a split read has no single `total`), or call a `POST` route the other service wrote by hand through `dataSource.read({ paths, method: 'POST', body: { filter } })`.
|
|
201
201
|
- An empty bulk `where` is refused before any request, as the server would refuse it; `force` cannot cross HTTP.
|
|
202
202
|
- `shouldReturn: false` answers the count with `data: null`. The count is the server's `x-response-count`.
|
|
203
|
-
- A failed write - or read - throws
|
|
203
|
+
- A failed write - or read - throws the `ApplicationError` the server threw: its status, `normalized` code, args and text, and its `extra` with the `requestId` added. The message names the verb, status and path - never the host or the query. A 422's per-field issues (`{ path, message, code }`) are the error's `cause`.
|
|
204
|
+
- An empty, `.` or `..` id is refused before any request: a URL resolves those to the list or the parent route.
|
|
204
205
|
- There is no `createAll`: the IGNIS REST contract has no bulk-create route.
|
|
205
206
|
|
|
206
207
|
For a route the verbs do not cover - a `PUT`, an upload, an action endpoint - call the datasource:
|
|
@@ -219,6 +220,43 @@ const response = await catalogDataSource.request({
|
|
|
219
220
|
|
|
220
221
|
`write` answers `{ data, count }` and throws on a non-2xx; `request` answers the raw `Response`. Both carry the auth token, and the 401 retry resends the same body.
|
|
221
222
|
|
|
223
|
+
### Settings that follow the session
|
|
224
|
+
|
|
225
|
+
A browser app's headers and token change while it runs. Give the datasource hooks, not values. `headersResolver` and `authTokenResolver` run on every send, the 401 retry included; `onUnauthorized` runs on a 401. All three are told which request they serve (`{ paths, method, url, signal }`):
|
|
226
|
+
|
|
227
|
+
```typescript
|
|
228
|
+
new HttpDataSource({
|
|
229
|
+
baseUrl: '/api',
|
|
230
|
+
errorRootKey: 'error',
|
|
231
|
+
headersResolver: () => ({ 'x-locale': session.locale }),
|
|
232
|
+
authTokenResolver: ({ paths }) => (paths[0] === 'auth' ? undefined : session.token),
|
|
233
|
+
onUnauthorized: ({ paths }) => (paths[0] === 'auth' ? false : session.refresh()),
|
|
234
|
+
});
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
| Setting | Meaning |
|
|
238
|
+
|---|---|
|
|
239
|
+
| `baseUrl` | An absolute URL, or a path from the page origin (`/api`). A path-relative one (`api`) is refused: it would follow the current route. |
|
|
240
|
+
| `errorRootKey` | The server's `error.rootKey`. Without it, a wrapped error envelope reads as `core.system_error`. |
|
|
241
|
+
| `headers` | Sent on every request. |
|
|
242
|
+
| `headersResolver` | Headers for this request. Wins over `headers`. |
|
|
243
|
+
| `authToken` / `authTokenResolver` | The token. A fixed `authToken` wins and goes on every request; the resolver answering `undefined` sends none. |
|
|
244
|
+
| `onUnauthorized` | Runs on a 401; `true` retries once, `false` lets it stand. A call whose `signal` aborted meanwhile is not retried. |
|
|
245
|
+
|
|
246
|
+
One call adds its own headers and an abort signal through `options`, on every verb:
|
|
247
|
+
|
|
248
|
+
```typescript
|
|
249
|
+
const controller = new AbortController();
|
|
250
|
+
await productRepository.find({ filter, options: { headers: { 'x-trace': id }, signal: controller.signal } });
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
Header precedence, weakest first: `headers`, `headersResolver`, the call's own, then the connector's (`x-request-count`, `authorization`). A `FormData` body always carries the multipart content-type `fetch` writes, boundary included.
|
|
254
|
+
|
|
255
|
+
> [!WARNING]
|
|
256
|
+
> Cross-origin, `count()` and `find({ options: { shouldQueryRange: true } })` read `Content-Range`, which a browser hides unless the server lists it in `Access-Control-Expose-Headers` (with `x-response-count` for writes).
|
|
257
|
+
|
|
258
|
+
The connector's readers are exported for a client that talks to the same server: `HttpResponseReader.parseContentRange({ header })`, `HttpResponseReader.readErrorEnvelope({ body, rootKey })` and `HttpResponseReader.readError({ response, rootKey })`.
|
|
259
|
+
|
|
222
260
|
## See also
|
|
223
261
|
|
|
224
262
|
- [Relations & Includes](./relations) - eager loading, nested `scope` filters, many-to-many
|
|
@@ -47,12 +47,12 @@ instead of breaking later inside the router.
|
|
|
47
47
|
- `init()` - Register the core bindings; call it once before `start()`
|
|
48
48
|
- `initialize()` - Run the boot sequence; `start()` already calls it for you
|
|
49
49
|
- `start()` - Initialize, set up middlewares, then bind the socket
|
|
50
|
-
- `stop()` -
|
|
50
|
+
- `stop()` - Run the post-stop hooks, stop the server, then close every datasource (even when stopping the server fails)
|
|
51
51
|
|
|
52
52
|
### BaseRestController
|
|
53
53
|
|
|
54
54
|
```typescript
|
|
55
|
-
import { BaseRestController, controller, get } from '@venizia/ignis';
|
|
55
|
+
import { BaseRestController, controller, get, TRouteContext } from '@venizia/ignis';
|
|
56
56
|
|
|
57
57
|
@controller({ path: '/users' })
|
|
58
58
|
class UserController extends BaseRestController {
|
|
@@ -63,7 +63,7 @@ class UserController extends BaseRestController {
|
|
|
63
63
|
override binding() {}
|
|
64
64
|
|
|
65
65
|
@get({ configs: { path: '/:id', responses: { 200: { description: 'User' } } } })
|
|
66
|
-
getUser(c:
|
|
66
|
+
getUser(c: TRouteContext) {
|
|
67
67
|
const id = c.req.param('id');
|
|
68
68
|
return c.json({ id, name: 'John' });
|
|
69
69
|
}
|
|
@@ -80,6 +80,7 @@ class UserController extends BaseRestController {
|
|
|
80
80
|
```typescript
|
|
81
81
|
import { BaseGrpcController, controller, unary, ControllerTransports } from '@venizia/ignis';
|
|
82
82
|
import { GreeterService } from '../gen/greeter_connect';
|
|
83
|
+
import type { SayHelloRequest } from '../gen/greeter_pb';
|
|
83
84
|
|
|
84
85
|
@controller({ path: '/grpc', transport: ControllerTransports.GRPC, service: GreeterService })
|
|
85
86
|
class GreeterController extends BaseGrpcController {
|
|
@@ -90,8 +91,8 @@ class GreeterController extends BaseGrpcController {
|
|
|
90
91
|
override binding() {}
|
|
91
92
|
|
|
92
93
|
@unary({ configs: { name: 'sayHello' } })
|
|
93
|
-
async sayHello(request: SayHelloRequest) {
|
|
94
|
-
return { message: `Hello, ${request.name}!` };
|
|
94
|
+
async sayHello(opts: { request: SayHelloRequest }) {
|
|
95
|
+
return { message: `Hello, ${opts.request.name}!` };
|
|
95
96
|
}
|
|
96
97
|
}
|
|
97
98
|
```
|
|
@@ -99,15 +100,18 @@ class GreeterController extends BaseGrpcController {
|
|
|
99
100
|
### BaseService
|
|
100
101
|
|
|
101
102
|
```typescript
|
|
102
|
-
import { BaseService } from '@venizia/ignis';
|
|
103
|
+
import { BaseService, inject } from '@venizia/ignis';
|
|
104
|
+
import { UserRepository } from '../repositories';
|
|
103
105
|
|
|
104
106
|
class UserService extends BaseService {
|
|
105
|
-
constructor(
|
|
107
|
+
constructor(
|
|
108
|
+
@inject({ key: 'repositories.UserRepository' }) private userRepository: UserRepository,
|
|
109
|
+
) {
|
|
106
110
|
super({ scope: UserService.name });
|
|
107
111
|
}
|
|
108
112
|
|
|
109
113
|
async getUser(id: string) {
|
|
110
|
-
this.logger.info('Getting user', id);
|
|
114
|
+
this.logger.info('Getting user | id: %s', id);
|
|
111
115
|
return this.userRepository.findById({ id });
|
|
112
116
|
}
|
|
113
117
|
}
|
|
@@ -184,9 +188,14 @@ class User extends BaseEntity {
|
|
|
184
188
|
| `@clientStream()` | Client streaming | `@clientStream({ configs: { name: 'uploadData' } })` |
|
|
185
189
|
| `@bidiStream()` | Bidirectional | `@bidiStream({ configs: { name: 'chat' } })` |
|
|
186
190
|
|
|
191
|
+
> [!WARNING]
|
|
192
|
+
> Only `@unary` runs today. A controller with a streaming method throws when it is configured.
|
|
193
|
+
|
|
187
194
|
### REST Example
|
|
188
195
|
|
|
189
196
|
```typescript
|
|
197
|
+
import { BaseRestController, controller, get, inject, post, TRouteContext } from '@venizia/ignis';
|
|
198
|
+
|
|
190
199
|
@controller({ path: '/users' })
|
|
191
200
|
class UserController extends BaseRestController {
|
|
192
201
|
constructor(
|
|
@@ -198,14 +207,14 @@ class UserController extends BaseRestController {
|
|
|
198
207
|
override binding() {}
|
|
199
208
|
|
|
200
209
|
@post({ configs: { path: '/', responses: { 201: { description: 'Created' } } } })
|
|
201
|
-
async createUser(c:
|
|
210
|
+
async createUser(c: TRouteContext) {
|
|
202
211
|
const data = await c.req.json();
|
|
203
212
|
const result = await this.userService.create(data);
|
|
204
213
|
return c.json(result, 201);
|
|
205
214
|
}
|
|
206
215
|
|
|
207
216
|
@get({ configs: { path: '/:id', responses: { 200: { description: 'User' } } } })
|
|
208
|
-
async getUser(c:
|
|
217
|
+
async getUser(c: TRouteContext) {
|
|
209
218
|
const id = c.req.param('id');
|
|
210
219
|
const result = await this.userService.findById(id);
|
|
211
220
|
return c.json(result);
|
|
@@ -256,7 +265,7 @@ class UserController extends BaseRestController {
|
|
|
256
265
|
|----------|-----|---------|
|
|
257
266
|
| `and` | `AND` | `{ and: [{ age: { gt: 18 } }, { status: 'active' }] }` |
|
|
258
267
|
| `or` | `OR` | `{ or: [{ role: 'admin' }, { role: 'moderator' }] }` |
|
|
259
|
-
| `not` | `NOT` | `{
|
|
268
|
+
| `not` | `NOT (...)` | `{ status: { not: 'deleted' } }` - inside a column, never at the top level |
|
|
260
269
|
|
|
261
270
|
### Array Operators (PostgreSQL)
|
|
262
271
|
|
|
@@ -367,6 +376,7 @@ import {
|
|
|
367
376
|
|
|
368
377
|
// Repositories
|
|
369
378
|
DefaultCRUDRepository,
|
|
379
|
+
repository,
|
|
370
380
|
|
|
371
381
|
// Models
|
|
372
382
|
BaseEntity,
|
|
@@ -437,7 +447,7 @@ import { BindingNamespaces } from '@venizia/ignis';
|
|
|
437
447
|
### JSON Response
|
|
438
448
|
|
|
439
449
|
```typescript
|
|
440
|
-
import { jsonResponse } from '@venizia/ignis';
|
|
450
|
+
import { jsonResponse, TRouteContext } from '@venizia/ignis';
|
|
441
451
|
import { z } from '@hono/zod-openapi';
|
|
442
452
|
|
|
443
453
|
@get({
|
|
@@ -453,7 +463,7 @@ import { z } from '@hono/zod-openapi';
|
|
|
453
463
|
}),
|
|
454
464
|
},
|
|
455
465
|
})
|
|
456
|
-
getUser(c:
|
|
466
|
+
getUser(c: TRouteContext) {
|
|
457
467
|
const id = c.req.param('id');
|
|
458
468
|
return c.json({ id, name: 'John', email: 'john@example.com' });
|
|
459
469
|
}
|
|
@@ -462,7 +472,7 @@ getUser(c: Context) {
|
|
|
462
472
|
### HTML Response
|
|
463
473
|
|
|
464
474
|
```typescript
|
|
465
|
-
import { htmlResponse } from '@venizia/ignis';
|
|
475
|
+
import { htmlResponse, TRouteContext } from '@venizia/ignis';
|
|
466
476
|
|
|
467
477
|
@get({
|
|
468
478
|
configs: {
|
|
@@ -472,7 +482,7 @@ import { htmlResponse } from '@venizia/ignis';
|
|
|
472
482
|
}),
|
|
473
483
|
},
|
|
474
484
|
})
|
|
475
|
-
getDashboard(c:
|
|
485
|
+
getDashboard(c: TRouteContext) {
|
|
476
486
|
return c.html(<DashboardPage />);
|
|
477
487
|
}
|
|
478
488
|
```
|
|
@@ -571,7 +581,21 @@ class MyApplication extends BaseApplication {
|
|
|
571
581
|
### Controller → Service → Repository
|
|
572
582
|
|
|
573
583
|
```typescript
|
|
584
|
+
import {
|
|
585
|
+
BaseRestController,
|
|
586
|
+
BaseService,
|
|
587
|
+
controller,
|
|
588
|
+
DefaultCRUDRepository,
|
|
589
|
+
inject,
|
|
590
|
+
post,
|
|
591
|
+
repository,
|
|
592
|
+
TRouteContext,
|
|
593
|
+
} from '@venizia/ignis';
|
|
574
594
|
import { genSalt, hash } from 'bcrypt';
|
|
595
|
+
import { PostgresDataSource } from '../datasources';
|
|
596
|
+
import { User } from '../models';
|
|
597
|
+
|
|
598
|
+
type CreateUserDto = { name: string; email: string; password: string };
|
|
575
599
|
|
|
576
600
|
// Controller
|
|
577
601
|
@controller({ path: '/users' })
|
|
@@ -586,7 +610,7 @@ class UserController extends BaseRestController {
|
|
|
586
610
|
override binding() {}
|
|
587
611
|
|
|
588
612
|
@post({ configs: { path: '/', responses: { 201: { description: 'Created' } } } })
|
|
589
|
-
async createUser(c:
|
|
613
|
+
async createUser(c: TRouteContext) {
|
|
590
614
|
const data = await c.req.json();
|
|
591
615
|
return c.json(await this.userService.create(data), 201);
|
|
592
616
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@venizia/ignis-atlas",
|
|
3
|
-
"version": "0.1.1-
|
|
3
|
+
"version": "0.1.1-4",
|
|
4
4
|
"description": "MCP server for IGNIS: search and read the wiki, changelogs and knowledge bundle by section, with citations. Bun-only, zero-dependency transport.",
|
|
5
5
|
"homepage": "https://ignis.venizia.ai",
|
|
6
6
|
"repository": {
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@types/bun": "^1.4.1",
|
|
68
|
-
"@venizia/dev-configs": "^0.2.0",
|
|
68
|
+
"@venizia/dev-configs": "^0.2.1-0",
|
|
69
69
|
"eslint": "^10.10.0",
|
|
70
70
|
"prettier": "^3.9.6",
|
|
71
71
|
"tsc-alias": "^1.9.4",
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Reads Whose Filter Rides in the Body
|
|
3
|
-
description: "Every generated CRUD controller answers POST /find and POST /count with the filter or where in the body, so a long inq no longer overflows the URL, and the http connector switches to it on its own."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Changelog - 2026-10-02
|
|
7
|
-
|
|
8
|
-
## `POST /find` and `POST /count`
|
|
9
|
-
|
|
10
|
-
<Badge type="tip" text="Feature" />
|
|
11
|
-
|
|
12
|
-
**In one line.** A long `inq` no longer overflows the URL: every generated CRUD controller also reads with the filter in a JSON body, and the http connector moves a read there when its URL would be too long.
|
|
13
|
-
|
|
14
|
-
## What is new
|
|
15
|
-
|
|
16
|
-
| Method | Path | Body | Answers |
|
|
17
|
-
|---|---|---|---|
|
|
18
|
-
| `POST` | `/<resource>/find` | `{ filter }` | what `GET /<resource>` answers - the same rows, the same `Content-Range` |
|
|
19
|
-
| `POST` | `/<resource>/count` | `{ where }` | what `GET /<resource>/count` answers |
|
|
20
|
-
|
|
21
|
-
```ts
|
|
22
|
-
await fetch('/api/items/find', {
|
|
23
|
-
method: 'POST',
|
|
24
|
-
headers: { 'content-type': 'application/json' },
|
|
25
|
-
body: JSON.stringify({ filter: { where: { id: { inq: twoThousandIds } }, limit: 2000 } }),
|
|
26
|
-
});
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
- **Same rules as the GET.** Each POST rides its GET's route key: `routes.find` and `routes.count` - `enabled`, `authenticate`, `authorize`, the request schema - govern both, `enabledRoutes: ['find']` turns on both, and `getBaseWhere` scopes both. Disabling `find` never leaves a POST door open.
|
|
30
|
-
- **A readonly controller keeps them.** They only read.
|
|
31
|
-
- **`RestPaths.FIND`** (`'/find'`) names the new path.
|
|
32
|
-
- **The http connector switches on its own.** `HttpRepository`'s `find`, `findOne`, `count` and `existsWith` stay on GET while the URL is under 6,000 characters, and use `POST /<resource>/find` past that.
|
|
33
|
-
|
|
34
|
-
## A hand-written list route
|
|
35
|
-
|
|
36
|
-
The generated routes do not reach a route you wrote yourself. Give it a POST twin: the same `authenticate`/`authorize`, `request.body: jsonContent({ schema: FilterQuerySchema })` - `FilterQuerySchema` already accepts an object - and a handler that reads `context.req.valid('json')` where the GET reads `'query'`.
|
|
37
|
-
|
|
38
|
-
## Who is affected
|
|
39
|
-
|
|
40
|
-
- **Every generated CRUD controller** gains two routes, under the permissions its `find` and `count` already have. Its OpenAPI document lists them.
|
|
41
|
-
- **A test that pins the exact set of generated routes** sees two more.
|
|
42
|
-
- **An http connector client reading a very long filter from an older server** gets a 404 instead of the 414/431 that read would have hit before. Shorter reads are unchanged.
|
|
43
|
-
|
|
44
|
-
**Files:**
|
|
45
|
-
|
|
46
|
-
- [`packages/kernel/src/base/controllers/factory/crud/readable.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/kernel/src/base/controllers/factory/crud/readable.ts)
|
|
47
|
-
- [`packages/kernel/src/base/controllers/factory/definition.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/kernel/src/base/controllers/factory/definition.ts)
|
|
48
|
-
- [`packages/connectors/src/http/repository.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/connectors/src/http/repository.ts)
|