@venizia/ignis-atlas 0.1.1-3 → 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 -0
- package/dist/corpus/releases.json +46 -0
- package/dist/corpus/symbols.json +62 -12
- package/dist/corpus/wiki/best-practices/code-style-standards/tooling.md +16 -0
- package/dist/corpus/wiki/references/base/filter-system/quick-reference.md +1 -1
- package/dist/corpus/wiki/references/base/repositories/index.md +39 -1
- package/dist/corpus/wiki/references/quick-reference.md +40 -16
- package/package.json +2 -2
|
@@ -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,6 +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-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 |
|
|
20
22
|
| 2026-10-02 | [HTTP Connector Errors Keep the Server Message Args](./2026-10-02-http-connector-error-args) | Bug Fix |
|
|
21
23
|
| 2026-10-02 | [The HTTP Connector Writes](./2026-10-02-http-connector-writes) | Feature |
|
|
22
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,12 @@
|
|
|
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
|
+
},
|
|
16
22
|
{
|
|
17
23
|
"version": "0.1.1-2",
|
|
18
24
|
"date": "2026-10-02",
|
|
@@ -767,6 +773,12 @@
|
|
|
767
773
|
}
|
|
768
774
|
],
|
|
769
775
|
"connectors": [
|
|
776
|
+
{
|
|
777
|
+
"version": "0.2.1-4",
|
|
778
|
+
"date": "2026-10-06",
|
|
779
|
+
"sha": "1b52b7d2",
|
|
780
|
+
"order": 1568
|
|
781
|
+
},
|
|
770
782
|
{
|
|
771
783
|
"version": "0.2.1-3",
|
|
772
784
|
"date": "2026-10-02",
|
|
@@ -1929,6 +1941,12 @@
|
|
|
1929
1941
|
}
|
|
1930
1942
|
],
|
|
1931
1943
|
"core-server": [
|
|
1944
|
+
{
|
|
1945
|
+
"version": "0.2.1-4",
|
|
1946
|
+
"date": "2026-10-06",
|
|
1947
|
+
"sha": "69f2f7f0",
|
|
1948
|
+
"order": 1569
|
|
1949
|
+
},
|
|
1932
1950
|
{
|
|
1933
1951
|
"version": "0.2.1-3",
|
|
1934
1952
|
"date": "2026-10-02",
|
|
@@ -2563,6 +2581,12 @@
|
|
|
2563
2581
|
}
|
|
2564
2582
|
],
|
|
2565
2583
|
"dev-configs": [
|
|
2584
|
+
{
|
|
2585
|
+
"version": "0.2.1-0",
|
|
2586
|
+
"date": "2026-10-06",
|
|
2587
|
+
"sha": "d5e516dd",
|
|
2588
|
+
"order": 1567
|
|
2589
|
+
},
|
|
2566
2590
|
{
|
|
2567
2591
|
"version": "0.2.0",
|
|
2568
2592
|
"date": "2026-09-24",
|
|
@@ -4516,6 +4540,28 @@
|
|
|
4516
4540
|
]
|
|
4517
4541
|
},
|
|
4518
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
|
+
},
|
|
4519
4565
|
{
|
|
4520
4566
|
"id": "changelog:2026-10-02-http-connector-writes",
|
|
4521
4567
|
"file": "2026-10-02-http-connector-writes.md",
|
package/dist/corpus/symbols.json
CHANGED
|
@@ -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",
|
|
@@ -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:
|
|
@@ -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.
|
|
@@ -200,7 +200,8 @@ await productRepository.deleteAll({ where: { id: { inq: staleIds } } });
|
|
|
200
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",
|