@venizia/ignis-atlas 0.1.1-7 → 0.1.1-9
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-07-list-extras.md +1 -0
- package/dist/corpus/changelogs/2026-10-09-const-value-literals.md +69 -0
- package/dist/corpus/changelogs/2026-10-11-error-message-placeholders.md +56 -0
- package/dist/corpus/changelogs/index.md +2 -0
- package/dist/corpus/releases.json +53 -0
- package/dist/corpus/symbols.json +31 -31
- package/dist/corpus/wiki/best-practices/error-handling.md +2 -0
- package/dist/corpus/wiki/extensions/helpers/error/index.md +5 -3
- package/dist/corpus/wiki/extensions/helpers/inversion/reference.md +1 -1
- package/dist/corpus/wiki/extensions/helpers/types/reference.md +5 -3
- package/package.json +2 -2
|
@@ -84,6 +84,7 @@ To read extras without rows, send `limit: 0`.
|
|
|
84
84
|
- **A route that hand-builds a `{ facets, data }`-style body.** Move the figures into `respond({ extra })`: cheap, always-shown figures as defaults; per-dimension figures as a group; the rest plain. Clients read `extra.facets` instead of `facets`.
|
|
85
85
|
- **A route that adds a DEFAULT extra.** Its list body becomes `{ data, extra }` for every client. A connector older than this release reads only a bare array or `{ count, data }`, so it fails on that route; upgrade the client first.
|
|
86
86
|
- **A server that lists its CORS headers by hand.** Add `...HTTP.CorsHeaders.ALLOW` and `...HTTP.CorsHeaders.EXPOSE`, or at least `x-request-extra` and `x-response-extra`. Otherwise the browser preflight fails.
|
|
87
|
+
- **A subclass of `HttpRepository` that overrides `find`.** `find` now has five overloads, one per combination of range and `extra`, plus one for a range or `extra` decided at run time. An override that declares only the old two fails with TS2416. Declare the same five overloads in the subclass.
|
|
87
88
|
- **Everyone else.** No change. Routes that offer no extras ignore `x-request-extra`, and `respond` and `find` without `extra` behave as before.
|
|
88
89
|
|
|
89
90
|
**Files:** [`packages/kernel/src/base/controllers/rest/extras.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/kernel/src/base/controllers/rest/extras.ts), [`packages/kernel/src/base/controllers/rest/base.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/kernel/src/base/controllers/rest/base.ts), [`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)
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Const Values Stay Literal
|
|
3
|
+
description: "TConstValue, TStringConstValue and TNumberConstValue no longer widen to string or number in an object literal, a let or an inferred generic. A test that compares one of these values with a plain string needs a type argument."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Changelog - 2026-10-09
|
|
7
|
+
|
|
8
|
+
## Const values stay literal
|
|
9
|
+
|
|
10
|
+
<Badge type="info" text="Bug Fix" /> <Badge type="warning" text="Breaking Change" />
|
|
11
|
+
|
|
12
|
+
**In one line.** A value typed with `TConstValue<typeof X>` keeps its literal union wherever it goes.
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
class Periods {
|
|
16
|
+
static readonly HALF_DAY = '12h';
|
|
17
|
+
static readonly DAY = '24h';
|
|
18
|
+
}
|
|
19
|
+
type TPeriod = TConstValue<typeof Periods>; // '12h' | '24h'
|
|
20
|
+
|
|
21
|
+
const rows: { value: TPeriod }[] = [{ value: Periods.HALF_DAY }, { value: Periods.DAY }];
|
|
22
|
+
const mapped = rows.map(row => ({ value: row.value }));
|
|
23
|
+
const typed: { value: TPeriod }[] = mapped; // compiled only after this fix
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## What changed
|
|
27
|
+
|
|
28
|
+
- **The three aliases end in `& {}`.** `TConstValue`, `TStringConstValue` and `TNumberConstValue` in `@venizia/ignis-helpers`, and `TConstValue` in `@venizia/ignis-inversion`, have the same members as before.
|
|
29
|
+
- **The members no longer widen.** Before, a value of these types became `string` or `number` inside an object literal, in a `let`, or in a method's inferred return type.
|
|
30
|
+
- **Nothing else moves.** Class members are still assignable (`Periods.DAY`). The union still works as `Record` keys, with `satisfies`, in overloads and in exhaustive `switch`es. In generic code it converts both ways with `Extract<ValueOf<T>, ...>`.
|
|
31
|
+
|
|
32
|
+
## Who is affected
|
|
33
|
+
|
|
34
|
+
- **Code that copied the value into an object or a `let`.** The type is now the literal union, as it always should have been. Casts or explicit return types added to work around the widening can go.
|
|
35
|
+
- **A generic inferred from one of these values, then given a plain `string`.** It no longer compiles. In practice this is a test: `expect(value).toBe(someString)`. See below.
|
|
36
|
+
- **Everyone else.** No action needed.
|
|
37
|
+
|
|
38
|
+
## Breaking changes
|
|
39
|
+
|
|
40
|
+
> [!WARNING]
|
|
41
|
+
> A generic inferred from a `TConstValue` value is now the literal union, so a plain `string` argument no longer fits it.
|
|
42
|
+
|
|
43
|
+
**Before:**
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
for (const [unit, expected] of table) {
|
|
47
|
+
// unit: TConstValue<typeof DurationUnits>, expected: string
|
|
48
|
+
expect(unit).toBe(expected);
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**After:**
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
for (const [unit, expected] of table) {
|
|
56
|
+
expect<string>(unit).toBe(expected);
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Give the generic the wider type, as above, or type the expected value with the same alias.
|
|
61
|
+
|
|
62
|
+
## Details
|
|
63
|
+
|
|
64
|
+
- A `static readonly` initializer gives each member a widening literal type. `Extract<ValueOf<T>, ...>` passed that type through unchanged, so TypeScript widened it at the first mutable position. Intersecting with `{}` makes it a regular literal union with the same members.
|
|
65
|
+
- A method that returned one of these values in an object, with no return type, widened it too. An explicit return type added for that reason still compiles, and is no longer required.
|
|
66
|
+
|
|
67
|
+
**Files:** [`packages/helpers/src/common/types/const-value.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/helpers/src/common/types/const-value.ts), [`packages/inversion/src/common/types.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/inversion/src/common/types.ts)
|
|
68
|
+
|
|
69
|
+
See [Const value extraction types](/extensions/helpers/types/reference#const-value-extraction-types) for the reference.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Error Messages Fill Their Placeholders
|
|
3
|
+
description: "The error response's message fills each %{key} from normalized.args, so a client with no translation for the code shows readable text. normalized.text, Error.message and the log keep the template."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Changelog - 2026-10-11
|
|
7
|
+
|
|
8
|
+
## Error messages fill their placeholders
|
|
9
|
+
|
|
10
|
+
<Badge type="tip" text="Enhancement" /> <Badge type="warning" text="Behavior Change" />
|
|
11
|
+
|
|
12
|
+
**In one line.** The response `message` of an intentional error is ready to show.
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
throw getError({
|
|
16
|
+
message: { text: 'Only %{available} left of %{variantId}.', code: 'stock.unavailable' },
|
|
17
|
+
messageArgs: { available: 2, variantId: 'V1' },
|
|
18
|
+
statusCode: 409,
|
|
19
|
+
});
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"message": "Only 2 left of V1.",
|
|
25
|
+
"normalized": {
|
|
26
|
+
"text": "Only %{available} left of %{variantId}.",
|
|
27
|
+
"code": "stock.unavailable",
|
|
28
|
+
"args": { "available": 2, "variantId": "V1" }
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Before, `message` was the raw template. A client that fell back to `message` for a code it could not translate showed `%{available}` to the user.
|
|
34
|
+
|
|
35
|
+
## What changed
|
|
36
|
+
|
|
37
|
+
- **`message` is filled.** The error middleware replaces each `%{key}` with `String(args[key])` from `normalized.args`.
|
|
38
|
+
- **`normalized.text` keeps the template.** A client that translates `code` + `args` works unchanged. A `transform` still changes only `normalized.text`.
|
|
39
|
+
- **`Error.message` and the log keep the template.** An arg value stays in the `args` map, where the log redacts secret-shaped keys.
|
|
40
|
+
- **A missing arg stays as written.** Outside production, the middleware logs one warning that names the code and the missing keys. Production stays silent.
|
|
41
|
+
- **Only an intentional error is filled.** A validation, database or unexpected error writes its own text, and that text passes through unchanged.
|
|
42
|
+
|
|
43
|
+
A route error inside a Worker host goes through the same middleware, so it answers the same body.
|
|
44
|
+
|
|
45
|
+
## Who is affected
|
|
46
|
+
|
|
47
|
+
- **A client that shows `message`.** It now shows readable text. No change needed.
|
|
48
|
+
- **A client or test that compares `message` with the catalog template.** Compare `normalized.text` instead, or expect the filled text.
|
|
49
|
+
|
|
50
|
+
## Details
|
|
51
|
+
|
|
52
|
+
The fill runs in the response only. Filling `Error.message` too would print each value inline in the log line, outside the redacted `args` map.
|
|
53
|
+
|
|
54
|
+
**Files:** [`packages/kernel/src/base/middlewares/app-error/app-error.middleware.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/kernel/src/base/middlewares/app-error/app-error.middleware.ts), [`packages/kernel/src/base/middlewares/app-error/message.handler.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/kernel/src/base/middlewares/app-error/message.handler.ts)
|
|
55
|
+
|
|
56
|
+
See [Read the error response shape](/extensions/helpers/error/#read-the-error-response-shape) for the full response.
|
|
@@ -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-11 | [Error Messages Fill Their Placeholders](./2026-10-11-error-message-placeholders) | Enhancement, Behavior Change |
|
|
21
|
+
| 2026-10-09 | [Const Values Stay Literal](./2026-10-09-const-value-literals) | Bug Fix, Breaking Change |
|
|
20
22
|
| 2026-10-07 | [HttpResponseReader Moves Next to the Server Contract](./2026-10-07-response-reader-in-kernel) | Enhancement |
|
|
21
23
|
| 2026-10-07 | [A List Answers Extras Only When They Are Asked For](./2026-10-07-list-extras) | Feature |
|
|
22
24
|
| 2026-10-06 | [Artifact Identity No Longer Rides on the Class Name](./2026-10-06-artifact-identity) | Bug Fix, Behavior Change |
|
|
@@ -13,6 +13,18 @@
|
|
|
13
13
|
],
|
|
14
14
|
"releases": {
|
|
15
15
|
"atlas": [
|
|
16
|
+
{
|
|
17
|
+
"version": "0.1.1-8",
|
|
18
|
+
"date": "2026-10-09",
|
|
19
|
+
"sha": "64d382a1",
|
|
20
|
+
"order": 1603
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"version": "0.1.1-7",
|
|
24
|
+
"date": "2026-10-07",
|
|
25
|
+
"sha": "a3e27ffc",
|
|
26
|
+
"order": 1597
|
|
27
|
+
},
|
|
16
28
|
{
|
|
17
29
|
"version": "0.1.1-6",
|
|
18
30
|
"date": "2026-10-07",
|
|
@@ -3249,6 +3261,12 @@
|
|
|
3249
3261
|
}
|
|
3250
3262
|
],
|
|
3251
3263
|
"helpers": [
|
|
3264
|
+
{
|
|
3265
|
+
"version": "0.2.1-3",
|
|
3266
|
+
"date": "2026-10-09",
|
|
3267
|
+
"sha": "aa9d34b7",
|
|
3268
|
+
"order": 1601
|
|
3269
|
+
},
|
|
3252
3270
|
{
|
|
3253
3271
|
"version": "0.2.1-2",
|
|
3254
3272
|
"date": "2026-10-07",
|
|
@@ -3983,6 +4001,12 @@
|
|
|
3983
4001
|
}
|
|
3984
4002
|
],
|
|
3985
4003
|
"inversion": [
|
|
4004
|
+
{
|
|
4005
|
+
"version": "0.2.1-1",
|
|
4006
|
+
"date": "2026-10-09",
|
|
4007
|
+
"sha": "27d86d67",
|
|
4008
|
+
"order": 1600
|
|
4009
|
+
},
|
|
3986
4010
|
{
|
|
3987
4011
|
"version": "0.2.1-0",
|
|
3988
4012
|
"date": "2026-10-06",
|
|
@@ -4321,6 +4345,12 @@
|
|
|
4321
4345
|
}
|
|
4322
4346
|
],
|
|
4323
4347
|
"kernel": [
|
|
4348
|
+
{
|
|
4349
|
+
"version": "0.2.1-6",
|
|
4350
|
+
"date": "2026-10-12",
|
|
4351
|
+
"sha": "c004a935",
|
|
4352
|
+
"order": 1605
|
|
4353
|
+
},
|
|
4324
4354
|
{
|
|
4325
4355
|
"version": "0.2.1-5",
|
|
4326
4356
|
"date": "2026-10-07",
|
|
@@ -4654,6 +4684,29 @@
|
|
|
4654
4684
|
]
|
|
4655
4685
|
},
|
|
4656
4686
|
"changelogs": [
|
|
4687
|
+
{
|
|
4688
|
+
"id": "changelog:2026-10-11-error-message-placeholders",
|
|
4689
|
+
"file": "2026-10-11-error-message-placeholders.md",
|
|
4690
|
+
"date": "2026-10-11",
|
|
4691
|
+
"title": "Error Messages Fill Their Placeholders",
|
|
4692
|
+
"packages": [
|
|
4693
|
+
"kernel"
|
|
4694
|
+
],
|
|
4695
|
+
"kind": "Enhancement",
|
|
4696
|
+
"order": 1604
|
|
4697
|
+
},
|
|
4698
|
+
{
|
|
4699
|
+
"id": "changelog:2026-10-09-const-value-literals",
|
|
4700
|
+
"file": "2026-10-09-const-value-literals.md",
|
|
4701
|
+
"date": "2026-10-09",
|
|
4702
|
+
"title": "Const Values Stay Literal",
|
|
4703
|
+
"packages": [
|
|
4704
|
+
"helpers",
|
|
4705
|
+
"inversion"
|
|
4706
|
+
],
|
|
4707
|
+
"kind": "Bug Fix",
|
|
4708
|
+
"order": 1599
|
|
4709
|
+
},
|
|
4657
4710
|
{
|
|
4658
4711
|
"id": "changelog:2026-10-07-response-reader-in-kernel",
|
|
4659
4712
|
"file": "2026-10-07-response-reader-in-kernel.md",
|
package/dist/corpus/symbols.json
CHANGED
|
@@ -629,7 +629,7 @@
|
|
|
629
629
|
"specifier": "@venizia/ignis",
|
|
630
630
|
"kind": "class",
|
|
631
631
|
"file": "packages/kernel/src/base/middlewares/app-error/app-error.middleware.ts",
|
|
632
|
-
"line":
|
|
632
|
+
"line": 88,
|
|
633
633
|
"signature": "class BaseAppErrorMiddleware extends BaseHelper implements IProvider<ErrorHandler>"
|
|
634
634
|
},
|
|
635
635
|
{
|
|
@@ -2071,7 +2071,7 @@
|
|
|
2071
2071
|
"specifier": "@venizia/ignis",
|
|
2072
2072
|
"kind": "interface",
|
|
2073
2073
|
"file": "packages/inversion/src/common/types.ts",
|
|
2074
|
-
"line":
|
|
2074
|
+
"line": 25,
|
|
2075
2075
|
"signature": "interface IBindingTag"
|
|
2076
2076
|
},
|
|
2077
2077
|
{
|
|
@@ -5932,7 +5932,7 @@
|
|
|
5932
5932
|
"specifier": "@venizia/ignis",
|
|
5933
5933
|
"kind": "type",
|
|
5934
5934
|
"file": "packages/inversion/src/common/types.ts",
|
|
5935
|
-
"line":
|
|
5935
|
+
"line": 23,
|
|
5936
5936
|
"signature": "type TBindingKey = string | symbol"
|
|
5937
5937
|
},
|
|
5938
5938
|
{
|
|
@@ -6102,8 +6102,8 @@
|
|
|
6102
6102
|
"specifier": "@venizia/ignis",
|
|
6103
6103
|
"kind": "type",
|
|
6104
6104
|
"file": "packages/helpers/src/common/types/const-value.ts",
|
|
6105
|
-
"line":
|
|
6106
|
-
"signature": "type TConstValue<T extends TClass<any>> = Extract<ValueOf<T>, string | number>"
|
|
6105
|
+
"line": 11,
|
|
6106
|
+
"signature": "type TConstValue<T extends TClass<any>> = Extract<ValueOf<T>, string | number> & {}"
|
|
6107
6107
|
},
|
|
6108
6108
|
{
|
|
6109
6109
|
"name": "TConstructor",
|
|
@@ -6472,7 +6472,7 @@
|
|
|
6472
6472
|
"specifier": "@venizia/ignis",
|
|
6473
6473
|
"kind": "type",
|
|
6474
6474
|
"file": "packages/kernel/src/base/middlewares/app-error/app-error.middleware.ts",
|
|
6475
|
-
"line":
|
|
6475
|
+
"line": 26,
|
|
6476
6476
|
"signature": "type TErrorLogFormatter = (opts: { error: unknown; messageCode?: string; extra?: Record<string, unknown>; includeStack?: boolean; maxStackFrames?: number; }) => string"
|
|
6477
6477
|
},
|
|
6478
6478
|
{
|
|
@@ -7182,8 +7182,8 @@
|
|
|
7182
7182
|
"specifier": "@venizia/ignis",
|
|
7183
7183
|
"kind": "type",
|
|
7184
7184
|
"file": "packages/helpers/src/common/types/const-value.ts",
|
|
7185
|
-
"line":
|
|
7186
|
-
"signature": "type TNumberConstValue<T extends TClass<any>> = Extract<ValueOf<T>, number>"
|
|
7185
|
+
"line": 10,
|
|
7186
|
+
"signature": "type TNumberConstValue<T extends TClass<any>> = Extract<ValueOf<T>, number> & {}"
|
|
7187
7187
|
},
|
|
7188
7188
|
{
|
|
7189
7189
|
"name": "TObjectFromFieldMappings",
|
|
@@ -7972,8 +7972,8 @@
|
|
|
7972
7972
|
"specifier": "@venizia/ignis",
|
|
7973
7973
|
"kind": "type",
|
|
7974
7974
|
"file": "packages/helpers/src/common/types/const-value.ts",
|
|
7975
|
-
"line":
|
|
7976
|
-
"signature": "type TStringConstValue<T extends TClass<any>> = Extract<ValueOf<T>, string>"
|
|
7975
|
+
"line": 9,
|
|
7976
|
+
"signature": "type TStringConstValue<T extends TClass<any>> = Extract<ValueOf<T>, string> & {}"
|
|
7977
7977
|
},
|
|
7978
7978
|
{
|
|
7979
7979
|
"name": "TSubsetGrantMetadata",
|
|
@@ -24423,8 +24423,8 @@
|
|
|
24423
24423
|
"specifier": "@venizia/ignis-helpers",
|
|
24424
24424
|
"kind": "type",
|
|
24425
24425
|
"file": "packages/helpers/src/common/types/const-value.ts",
|
|
24426
|
-
"line":
|
|
24427
|
-
"signature": "type TConstValue<T extends TClass<any>> = Extract<ValueOf<T>, string | number>"
|
|
24426
|
+
"line": 11,
|
|
24427
|
+
"signature": "type TConstValue<T extends TClass<any>> = Extract<ValueOf<T>, string | number> & {}"
|
|
24428
24428
|
},
|
|
24429
24429
|
{
|
|
24430
24430
|
"name": "TConstructor",
|
|
@@ -24813,8 +24813,8 @@
|
|
|
24813
24813
|
"specifier": "@venizia/ignis-helpers",
|
|
24814
24814
|
"kind": "type",
|
|
24815
24815
|
"file": "packages/helpers/src/common/types/const-value.ts",
|
|
24816
|
-
"line":
|
|
24817
|
-
"signature": "type TNumberConstValue<T extends TClass<any>> = Extract<ValueOf<T>, number>"
|
|
24816
|
+
"line": 10,
|
|
24817
|
+
"signature": "type TNumberConstValue<T extends TClass<any>> = Extract<ValueOf<T>, number> & {}"
|
|
24818
24818
|
},
|
|
24819
24819
|
{
|
|
24820
24820
|
"name": "TObjectFromFieldMappings",
|
|
@@ -25013,8 +25013,8 @@
|
|
|
25013
25013
|
"specifier": "@venizia/ignis-helpers",
|
|
25014
25014
|
"kind": "type",
|
|
25015
25015
|
"file": "packages/helpers/src/common/types/const-value.ts",
|
|
25016
|
-
"line":
|
|
25017
|
-
"signature": "type TStringConstValue<T extends TClass<any>> = Extract<ValueOf<T>, string>"
|
|
25016
|
+
"line": 9,
|
|
25017
|
+
"signature": "type TStringConstValue<T extends TClass<any>> = Extract<ValueOf<T>, string> & {}"
|
|
25018
25018
|
},
|
|
25019
25019
|
{
|
|
25020
25020
|
"name": "TTask",
|
|
@@ -26423,8 +26423,8 @@
|
|
|
26423
26423
|
"specifier": "@venizia/ignis-helpers/common",
|
|
26424
26424
|
"kind": "type",
|
|
26425
26425
|
"file": "packages/helpers/src/common/types/const-value.ts",
|
|
26426
|
-
"line":
|
|
26427
|
-
"signature": "type TConstValue<T extends TClass<any>> = Extract<ValueOf<T>, string | number>"
|
|
26426
|
+
"line": 11,
|
|
26427
|
+
"signature": "type TConstValue<T extends TClass<any>> = Extract<ValueOf<T>, string | number> & {}"
|
|
26428
26428
|
},
|
|
26429
26429
|
{
|
|
26430
26430
|
"name": "TConstructor",
|
|
@@ -26583,8 +26583,8 @@
|
|
|
26583
26583
|
"specifier": "@venizia/ignis-helpers/common",
|
|
26584
26584
|
"kind": "type",
|
|
26585
26585
|
"file": "packages/helpers/src/common/types/const-value.ts",
|
|
26586
|
-
"line":
|
|
26587
|
-
"signature": "type TNumberConstValue<T extends TClass<any>> = Extract<ValueOf<T>, number>"
|
|
26586
|
+
"line": 10,
|
|
26587
|
+
"signature": "type TNumberConstValue<T extends TClass<any>> = Extract<ValueOf<T>, number> & {}"
|
|
26588
26588
|
},
|
|
26589
26589
|
{
|
|
26590
26590
|
"name": "TObjectFromFieldMappings",
|
|
@@ -26643,8 +26643,8 @@
|
|
|
26643
26643
|
"specifier": "@venizia/ignis-helpers/common",
|
|
26644
26644
|
"kind": "type",
|
|
26645
26645
|
"file": "packages/helpers/src/common/types/const-value.ts",
|
|
26646
|
-
"line":
|
|
26647
|
-
"signature": "type TStringConstValue<T extends TClass<any>> = Extract<ValueOf<T>, string>"
|
|
26646
|
+
"line": 9,
|
|
26647
|
+
"signature": "type TStringConstValue<T extends TClass<any>> = Extract<ValueOf<T>, string> & {}"
|
|
26648
26648
|
},
|
|
26649
26649
|
{
|
|
26650
26650
|
"name": "TValueOrAsyncResolver",
|
|
@@ -28744,7 +28744,7 @@
|
|
|
28744
28744
|
"kind": "const",
|
|
28745
28745
|
"file": "packages/helpers/src/modules/logger/pino/backing.ts",
|
|
28746
28746
|
"line": 63,
|
|
28747
|
-
"signature": "buildPinoOptions: () => { name: string; level:
|
|
28747
|
+
"signature": "buildPinoOptions: () => { name: string; level: import(\"../common\").TLogLevel; customLevels: Record<\"emerg\", number>; }"
|
|
28748
28748
|
},
|
|
28749
28749
|
{
|
|
28750
28750
|
"name": "getPinoBackingLogger",
|
|
@@ -29513,7 +29513,7 @@
|
|
|
29513
29513
|
"specifier": "@venizia/ignis-inversion",
|
|
29514
29514
|
"kind": "interface",
|
|
29515
29515
|
"file": "packages/inversion/src/common/types.ts",
|
|
29516
|
-
"line":
|
|
29516
|
+
"line": 25,
|
|
29517
29517
|
"signature": "interface IBindingTag"
|
|
29518
29518
|
},
|
|
29519
29519
|
{
|
|
@@ -29643,7 +29643,7 @@
|
|
|
29643
29643
|
"specifier": "@venizia/ignis-inversion",
|
|
29644
29644
|
"kind": "type",
|
|
29645
29645
|
"file": "packages/inversion/src/common/types.ts",
|
|
29646
|
-
"line":
|
|
29646
|
+
"line": 23,
|
|
29647
29647
|
"signature": "type TBindingKey = string | symbol"
|
|
29648
29648
|
},
|
|
29649
29649
|
{
|
|
@@ -29703,8 +29703,8 @@
|
|
|
29703
29703
|
"specifier": "@venizia/ignis-inversion",
|
|
29704
29704
|
"kind": "type",
|
|
29705
29705
|
"file": "packages/inversion/src/common/types.ts",
|
|
29706
|
-
"line":
|
|
29707
|
-
"signature": "type TConstValue<T extends TClass<any>> = Extract<ValueOf<T>, string | number>"
|
|
29706
|
+
"line": 21,
|
|
29707
|
+
"signature": "type TConstValue<T extends TClass<any>> = Extract<ValueOf<T>, string | number> & {}"
|
|
29708
29708
|
},
|
|
29709
29709
|
{
|
|
29710
29710
|
"name": "TConstructor",
|
|
@@ -30413,7 +30413,7 @@
|
|
|
30413
30413
|
"specifier": "@venizia/ignis-kernel",
|
|
30414
30414
|
"kind": "class",
|
|
30415
30415
|
"file": "packages/kernel/src/base/middlewares/app-error/app-error.middleware.ts",
|
|
30416
|
-
"line":
|
|
30416
|
+
"line": 88,
|
|
30417
30417
|
"signature": "class BaseAppErrorMiddleware extends BaseHelper implements IProvider<ErrorHandler>"
|
|
30418
30418
|
},
|
|
30419
30419
|
{
|
|
@@ -31003,7 +31003,7 @@
|
|
|
31003
31003
|
"specifier": "@venizia/ignis-kernel",
|
|
31004
31004
|
"kind": "interface",
|
|
31005
31005
|
"file": "packages/inversion/src/common/types.ts",
|
|
31006
|
-
"line":
|
|
31006
|
+
"line": 25,
|
|
31007
31007
|
"signature": "interface IBindingTag"
|
|
31008
31008
|
},
|
|
31009
31009
|
{
|
|
@@ -32473,7 +32473,7 @@
|
|
|
32473
32473
|
"specifier": "@venizia/ignis-kernel",
|
|
32474
32474
|
"kind": "type",
|
|
32475
32475
|
"file": "packages/inversion/src/common/types.ts",
|
|
32476
|
-
"line":
|
|
32476
|
+
"line": 23,
|
|
32477
32477
|
"signature": "type TBindingKey = string | symbol"
|
|
32478
32478
|
},
|
|
32479
32479
|
{
|
|
@@ -32763,7 +32763,7 @@
|
|
|
32763
32763
|
"specifier": "@venizia/ignis-kernel",
|
|
32764
32764
|
"kind": "type",
|
|
32765
32765
|
"file": "packages/kernel/src/base/middlewares/app-error/app-error.middleware.ts",
|
|
32766
|
-
"line":
|
|
32766
|
+
"line": 26,
|
|
32767
32767
|
"signature": "type TErrorLogFormatter = (opts: { error: unknown; messageCode?: string; extra?: Record<string, unknown>; includeStack?: boolean; maxStackFrames?: number; }) => string"
|
|
32768
32768
|
},
|
|
32769
32769
|
{
|
|
@@ -349,6 +349,8 @@ interface ErrorResponse {
|
|
|
349
349
|
|
|
350
350
|
There's no top-level `messageCode` - read `normalized.code`. `extra` never mirrors `messageArgs`; the resolved interpolation values live at `normalized.args`.
|
|
351
351
|
|
|
352
|
+
An intentional error's `message` has each `%{key}` filled from `normalized.args`, so a client can show it as is. `normalized.text` keeps the template for a client that translates `code` + `args`.
|
|
353
|
+
|
|
352
354
|
**400 Bad Request:**
|
|
353
355
|
|
|
354
356
|
```json
|
|
@@ -266,7 +266,7 @@ const NOT_FOUND = MessageCode.build({ parts: ['core', 'user', 'not_found'] });
|
|
|
266
266
|
| `ZodError` (validation) | 422 | the first issue's `params.code`, else its raw Zod code | that issue's message; per-field list in `details.cause` | never |
|
|
267
267
|
| DB client error (SQLSTATE class 22/23/44) | 400 | `core.system_error` | a fixed, safe summary - never the driver's text | never |
|
|
268
268
|
| Transient DB conflict (40001/40P01) | 409 | `database.conflict` | a fixed retry message | never |
|
|
269
|
-
| `getError(...)` - intentional | its own | its own | its own
|
|
269
|
+
| `getError(...)` - intentional | its own | its own | its own, with each `%{key}` filled from `normalized.args` | when the throw site attached `extra` or unknown keys |
|
|
270
270
|
| Anything else | 500 | `core.system_error` | `Internal Server Error` in production; the raw message in development | never |
|
|
271
271
|
|
|
272
272
|
Only the intentional branch reports what the throw site wrote. The other four **replace** the message - a driver error can carry SQL, schema, and constraint names. `normalized` is built from that replacement, so it can never leak what `message` just scrubbed.
|
|
@@ -277,7 +277,7 @@ The handler is fail-closed on environment. It exposes `stack` and `cause` in `de
|
|
|
277
277
|
|
|
278
278
|
```json
|
|
279
279
|
{
|
|
280
|
-
"message": "Only
|
|
280
|
+
"message": "Only 2 left of V1.",
|
|
281
281
|
"statusCode": 409,
|
|
282
282
|
"normalized": {
|
|
283
283
|
"text": "Only %{available} left of %{variantId}.",
|
|
@@ -300,7 +300,9 @@ The handler is fail-closed on environment. It exposes `stack` and `cause` in `de
|
|
|
300
300
|
> Note the two `details`. The inner one is context the throw site attached - it went through `extra`. The outer one is the middleware's own request info. They're unrelated despite sharing a name.
|
|
301
301
|
|
|
302
302
|
> [!NOTE]
|
|
303
|
-
> `message`
|
|
303
|
+
> `message` is ready to show: the middleware fills each `%{key}` with `String(args[key])` from `normalized.args`. `normalized.text` keeps the template, so a client that translates `code` + `args` formats it itself. A `transform` changes only `normalized.text`.
|
|
304
|
+
>
|
|
305
|
+
> A key with no arg stays as written. Outside production, the middleware logs one warning naming the code and the missing keys. `Error.message` and the log line keep the template, so an arg value never leaves the redacted `args` map.
|
|
304
306
|
|
|
305
307
|
### Consume the error response from a browser client
|
|
306
308
|
|
|
@@ -456,7 +456,7 @@ type ValueOf<T> = T[keyof T];
|
|
|
456
456
|
type TConstructor<T> = new (...args: any[]) => T;
|
|
457
457
|
type TAbstractConstructor<T> = abstract new (...args: any[]) => T;
|
|
458
458
|
type TClass<T> = TConstructor<T> & { [property: string]: any };
|
|
459
|
-
type TConstValue<T extends TClass<any>> = Extract<ValueOf<T>, string | number
|
|
459
|
+
type TConstValue<T extends TClass<any>> = Extract<ValueOf<T>, string | number> & {};
|
|
460
460
|
type TBindingKey = string | symbol;
|
|
461
461
|
type AnyType = any;
|
|
462
462
|
|
|
@@ -223,11 +223,13 @@ type TPrettify<T> = { [K in keyof T]: T[K] } & {};
|
|
|
223
223
|
`Source ->` [`types/const-value.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/helpers/src/common/types/const-value.ts)
|
|
224
224
|
|
|
225
225
|
```typescript
|
|
226
|
-
type TStringConstValue<T extends TClass<any>> = Extract<ValueOf<T>, string
|
|
227
|
-
type TNumberConstValue<T extends TClass<any>> = Extract<ValueOf<T>, number
|
|
228
|
-
type TConstValue<T extends TClass<any>> = Extract<ValueOf<T>, string | number
|
|
226
|
+
type TStringConstValue<T extends TClass<any>> = Extract<ValueOf<T>, string> & {};
|
|
227
|
+
type TNumberConstValue<T extends TClass<any>> = Extract<ValueOf<T>, number> & {};
|
|
228
|
+
type TConstValue<T extends TClass<any>> = Extract<ValueOf<T>, string | number> & {};
|
|
229
229
|
```
|
|
230
230
|
|
|
231
|
+
The `& {}` keeps the union literal: a value copied into an object literal, a `let` or an inferred generic stays `'node' | 'bun'`, not `string`.
|
|
232
|
+
|
|
231
233
|
| Type | Meaning | Use |
|
|
232
234
|
|------|---------|-----|
|
|
233
235
|
| `TStringConstValue<T>` | The string-valued subset of `ValueOf<T>` | Deriving a string union from a const class with mixed value types |
|
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-9",
|
|
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": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@hono/zod-openapi": "^1.6.3",
|
|
63
|
-
"@venizia/ignis-helpers": "^0.2.1-
|
|
63
|
+
"@venizia/ignis-helpers": "^0.2.1-3",
|
|
64
64
|
"zod": "^4.5.4"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|