@ddd-ts-kit/http 0.110.0 → 0.111.0
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/README.fr.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[English](README.md) · **Français**
|
|
2
|
-
<!-- translation-of: README.md sha256:
|
|
2
|
+
<!-- translation-of: README.md sha256:ca0b1f9495bbcd23 -->
|
|
3
3
|
|
|
4
4
|
# @ddd-ts-kit/http
|
|
5
5
|
|
|
@@ -927,13 +927,14 @@ GET /appointments?filter[status]=in:booked,confirmed&filter[startsAt]=gte:2026-1
|
|
|
927
927
|
|
|
928
928
|
| Écrit | Signifie |
|
|
929
929
|
|---|---|
|
|
930
|
-
| `filter[<field>]=<operator>:<value>` | une condition. Les opérateurs sont ceux du kernel : `eq`, `ne`, `in`, `gt`, `gte`, `lt`, `lte`, `contains`, `startsWith`, `isNull`, `between` |
|
|
930
|
+
| `filter[<field>]=<operator>:<value>` | une condition. Les opérateurs sont ceux du kernel : `eq`, `ne`, `in`, `gt`, `gte`, `lt`, `lte`, `contains`, `startsWith`, `containsIgnoringCase`, `startsWithIgnoringCase`, `isNull`, `between` |
|
|
931
931
|
| `filter[<field>]=<value>` | `eq`. Le texte avant le premier deux-points n'est un opérateur que s'il en est le nom : `filter[title]=10:30 review` est un `eq`, et une valeur qui commence comme un opérateur s'écrit `eq:in:the morning` |
|
|
932
932
|
| plusieurs `filter[...]` | reliés par ET ; le même champ peut être répété : `filter[seats]=gte:2&filter[seats]=lte:4` |
|
|
933
933
|
| `in:<a>,<b>,<c>` | une liste, séparée par des virgules. Une virgule dans une valeur s'écrit `\,`, une barre oblique inverse `\\` ; un deux-points ne demande rien |
|
|
934
934
|
| `between:<from>,<to>` | deux valeurs, bornes comprises |
|
|
935
935
|
| `isNull:true`, `isNull:false`, `isNull` | sans valeur, ou avec une valeur ; `isNull` seul veut dire `true` |
|
|
936
936
|
| `contains:<text>`, `startsWith:<text>` | le texte tel quel, virgules comprises ; sensible à la casse |
|
|
937
|
+
| `containsIgnoringCase:<text>`, `startsWithIgnoringCase:<text>` | de même, quelle que soit la casse des lettres ; les accents sont gardés (la règle est dans le README du kernel, « Ce que signifient des critères ») |
|
|
937
938
|
| `filter[or][<field>]=...` | les conditions écrites sous `or` sont des alternatives ; sous `not`, les lignes qui les satisfont toutes sont refusées ; `and` existe par symétrie |
|
|
938
939
|
| `filter[or][0][<field>]=...&filter[or][0][<other>]=...&filter[or][1][<field>]=...` | un indice tient plusieurs conditions ensemble dans un groupe : `or(and(...), ...)`. Il compte pour un niveau de profondeur de plus, que la définition autorise ou non (`maxDepth`, 1 par défaut) |
|
|
939
940
|
| `sort=-startsAt,id` | séparés par des virgules ou répétés, un `-` en tête pour l'ordre décroissant, parmi les champs déclarés triables et le champ de départage |
|
package/README.md
CHANGED
|
@@ -889,13 +889,14 @@ GET /appointments?filter[status]=in:booked,confirmed&filter[startsAt]=gte:2026-1
|
|
|
889
889
|
|
|
890
890
|
| Written | Means |
|
|
891
891
|
|---|---|
|
|
892
|
-
| `filter[<field>]=<operator>:<value>` | one condition. The operators are those of the kernel: `eq`, `ne`, `in`, `gt`, `gte`, `lt`, `lte`, `contains`, `startsWith`, `isNull`, `between` |
|
|
892
|
+
| `filter[<field>]=<operator>:<value>` | one condition. The operators are those of the kernel: `eq`, `ne`, `in`, `gt`, `gte`, `lt`, `lte`, `contains`, `startsWith`, `containsIgnoringCase`, `startsWithIgnoringCase`, `isNull`, `between` |
|
|
893
893
|
| `filter[<field>]=<value>` | `eq`. The text before the first colon is an operator only when it is the name of one: `filter[title]=10:30 review` is an `eq`, and a value that starts like an operator is written `eq:in:the morning` |
|
|
894
894
|
| several `filter[...]` | joined by AND; the same field may be repeated: `filter[seats]=gte:2&filter[seats]=lte:4` |
|
|
895
895
|
| `in:<a>,<b>,<c>` | a list, separated by commas. A comma inside a value is written `\,`, a backslash `\\`; a colon needs nothing |
|
|
896
896
|
| `between:<from>,<to>` | two values, both bounds included |
|
|
897
897
|
| `isNull:true`, `isNull:false`, `isNull` | without a value, or with one; `isNull` alone means `true` |
|
|
898
898
|
| `contains:<text>`, `startsWith:<text>` | the text as it is, commas included; case sensitive |
|
|
899
|
+
| `containsIgnoringCase:<text>`, `startsWithIgnoringCase:<text>` | the same, whatever the case of the letters; accents are kept (the folding rule is in the README of the kernel, "What a criteria means") |
|
|
899
900
|
| `filter[or][<field>]=...` | the conditions written under `or` are alternatives; under `not`, the rows that satisfy them all are refused; `and` exists for symmetry |
|
|
900
901
|
| `filter[or][0][<field>]=...&filter[or][0][<other>]=...&filter[or][1][<field>]=...` | an index holds several conditions together inside a group: `or(and(...), ...)`. It counts as one more level of depth, which the definition allows or not (`maxDepth`, 1 by default) |
|
|
901
902
|
| `sort=-startsAt,id` | comma-separated or repeated, a leading `-` for descending, among the fields declared sortable and the tie-breaker |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type FieldDeclaration, type FilterNode } from '@ddd-ts-kit/kernel';
|
|
2
2
|
/**
|
|
3
3
|
* The condition `<operator>:<value>` writes on a field, `undefined` when a value does not read
|
|
4
4
|
* as the type of the field. Without an operator the text is the value of `eq`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-condition.d.ts","sourceRoot":"","sources":["../../src/criteria/parse-condition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"parse-condition.d.ts","sourceRoot":"","sources":["../../src/criteria/parse-condition.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,gBAAgB,EAErB,KAAK,UAAU,EAEhB,MAAM,oBAAoB,CAAC;AA2B5B;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAK9G"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isTextSearch, } from '@ddd-ts-kit/kernel';
|
|
1
2
|
import { coerceValue } from './coerce-value.js';
|
|
2
3
|
import { splitList } from './split-list.js';
|
|
3
4
|
const OPERATORS = [
|
|
@@ -10,6 +11,8 @@ const OPERATORS = [
|
|
|
10
11
|
'lte',
|
|
11
12
|
'contains',
|
|
12
13
|
'startsWith',
|
|
14
|
+
'containsIgnoringCase',
|
|
15
|
+
'startsWithIgnoringCase',
|
|
13
16
|
'isNull',
|
|
14
17
|
'between',
|
|
15
18
|
];
|
|
@@ -32,12 +35,12 @@ function writtenOf(text) {
|
|
|
32
35
|
return { operator, text: rest ?? 'true' };
|
|
33
36
|
}
|
|
34
37
|
function operandOf(declared, operator, text) {
|
|
38
|
+
if (isTextSearch(operator)) {
|
|
39
|
+
return text;
|
|
40
|
+
}
|
|
35
41
|
switch (operator) {
|
|
36
42
|
case 'isNull':
|
|
37
43
|
return coerceValue('boolean', text);
|
|
38
|
-
case 'contains':
|
|
39
|
-
case 'startsWith':
|
|
40
|
-
return text;
|
|
41
44
|
case 'in':
|
|
42
45
|
case 'between':
|
|
43
46
|
return listOf(declared, text);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-condition.js","sourceRoot":"","sources":["../../src/criteria/parse-condition.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parse-condition.js","sourceRoot":"","sources":["../../src/criteria/parse-condition.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,GAKb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,SAAS,GAA8B;IAC3C,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,KAAK;IACL,UAAU;IACV,YAAY;IACZ,sBAAsB;IACtB,wBAAwB;IACxB,QAAQ;IACR,SAAS;CACV,C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C;QACV,KAAK,SAAS;YACZ,OAAO,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAChC;YACE,OAAO,WAAW,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC5C,CAAC;AACH,CAAC;AAED,SAAS,MAAM,CAAC,QAA0B,EAAE,IAAY;IACtD,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IAEzF,OAAO,MAAM,CAAC,MAAM,KAAK,SAAS,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACvE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ddd-ts-kit/http",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.111.0",
|
|
4
4
|
"description": "Framework-agnostic route definitions with Express, Fastify, Hono and NestJS adapters, oRPC and tRPC procedures and OpenAPI 3.1 generation.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ddd",
|
|
@@ -88,8 +88,8 @@
|
|
|
88
88
|
"dist"
|
|
89
89
|
],
|
|
90
90
|
"dependencies": {
|
|
91
|
-
"@ddd-ts-kit/kernel": "0.
|
|
92
|
-
"@ddd-ts-kit/validation": "0.
|
|
91
|
+
"@ddd-ts-kit/kernel": "0.111.0",
|
|
92
|
+
"@ddd-ts-kit/validation": "0.111.0"
|
|
93
93
|
},
|
|
94
94
|
"peerDependencies": {
|
|
95
95
|
"@nestjs/common": ">=11.0.0",
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
}
|
|
129
129
|
},
|
|
130
130
|
"devDependencies": {
|
|
131
|
-
"@ddd-ts-kit/testing": "0.
|
|
131
|
+
"@ddd-ts-kit/testing": "0.111.0",
|
|
132
132
|
"@hono/node-server": "^2.1.6",
|
|
133
133
|
"@nestjs/common": "^12.3.2",
|
|
134
134
|
"@nestjs/core": "^12.3.2",
|